<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent questions tagged aws-lambda</title>
<link>https://ask.clojure.org/index.php/tag/aws-lambda</link>
<description></description>
<item>
<title>Retrieve S3 Object from a Lambda</title>
<link>https://ask.clojure.org/index.php/8363/retrieve-s3-object-from-a-lambda</link>
<description>&lt;p&gt;I'm attempting to retrieve a file from S3 from within an AWS Lambda using Congitect's &lt;code&gt;aws-api&lt;/code&gt; library with a Java 8 runtime, but I'm consistently having problems:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(def s3 (aws/client {:api :s3}))

(defn open-file []
  (aws/invoke s3 {:op :GetObject :request {:Bucket &quot;test-bucket&quot; :Key &quot;filename.txt&quot;}}))

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When calling &lt;code&gt;open-file&lt;/code&gt; I get the following error:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{
  &quot;:cognitect.anomalies/category&quot;: {
    &quot;sym&quot;: {
      &quot;name&quot;: &quot;fault&quot;,
      &quot;namespace&quot;: &quot;cognitect.anomalies&quot;
    },
    &quot;name&quot;: &quot;fault&quot;,
    &quot;namespace&quot;: &quot;cognitect.anomalies&quot;
  },
  &quot;:cognitect.anomalies/message&quot;: &quot;java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer;&quot;,
  &quot;:cognitect.http-client/throwable&quot;: {
    &quot;stackTrace&quot;: [
      {
        &quot;methodName&quot;: &quot;invokeStatic&quot;,
        &quot;fileName&quot;: &quot;http_client.clj&quot;,
        &quot;lineNumber&quot;: 37,
        &quot;className&quot;: &quot;cognitect.http_client$empty_bbuf&quot;,
        &quot;nativeMethod&quot;: false
      }
   ...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Is this a problem with my code? It seems to work when not in a Lambda.&lt;/p&gt;
</description>
<category>Libs</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8363/retrieve-s3-object-from-a-lambda</guid>
<pubDate>Wed, 07 Aug 2019 15:55:48 +0000</pubDate>
</item>
<item>
<title>Has anyone benchmarked cold start times for Clojure on AWS Lambda?</title>
<link>https://ask.clojure.org/index.php/8292/has-anyone-benchmarked-cold-start-times-for-clojure-lambda</link>
<description>&lt;p&gt;I was going over this article: &lt;a rel=&quot;nofollow&quot; href=&quot;https://mikhail.io/serverless/coldstarts/aws/languages/&quot;&gt;https://mikhail.io/serverless/coldstarts/aws/languages/&lt;/a&gt; and noticed that even for Go, cold starts take in the order of 250ms to 450ms most of the time.&lt;/p&gt;
&lt;p&gt;My surprise was how slow even the &quot;fast to start&quot; languages were when hitting an AWS Lambda cold start. So I've been wondering how slow would Clojure actually be? Since Lambda cold start already come with a pretty big overhead, if we go from 300ms average with Go to 600ms average with Clojure for cold start, it might actually not matter that much, since we're already in the range of &quot;slow enough for the user to notice&quot;.&lt;/p&gt;
&lt;p&gt;But then I tried searching online, and I couldn't find any actual benchmark done with Clojure. I could only find ClojureScript or GraalVM native image Clojure benchmarks.&lt;/p&gt;
&lt;p&gt;Anyone has any Clojure benchmarks for AWS Lambda cold start (ideally as recent as possible, since AWS has improved their JVM cold starts quite a lot in recent years).&lt;/p&gt;
</description>
<category>Tools</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8292/has-anyone-benchmarked-cold-start-times-for-clojure-lambda</guid>
<pubDate>Thu, 01 Aug 2019 01:01:29 +0000</pubDate>
</item>
</channel>
</rss>