I looked into this a little over the weekend, and wrote a small library &
lein template/plugin for deploying Clojurescript functions to Lambda:
https://github.com/nervous-systems/cljs-lambda

There's a blog post / step-by-step tutorial here:
https://nervous.io/clojure/clojurescript/aws/lambda/node/lein/2015/07/05/lambda/

Take care,
Moe

On Wed, Jun 17, 2015 at 8:28 AM, Ragnar Dahlén <r.dah...@gmail.com> wrote:

> You can get the initial startup time down by AOT compiling. I also believe
> that Lambda will re-use the same runtime and lambda function instance until
> a certain period of inactivity.
>
> For example, in the example below I invoke the function (AOT compiled this
> time) three times. First invocation takes ~7s, the two following ~1.5ms.
>
>
> START RequestId: b555c9c2-14c1-11e5-8a31-03153568534c
> HELLO FROM CLOJURE :)
> #object[lambdainternal.api.LambdaClientContext 0x3419866c
> lambdainternal.api.LambdaClientContext@3419866c]
> END RequestId: b555c9c2-14c1-11e5-8a31-03153568534c
> REPORT RequestId: b555c9c2-14c1-11e5-8a31-03153568534c Duration: 7882.62
> ms Billed Duration: 7900 ms Memory Size: 512 MB Max Memory Used: 98 MB
> START RequestId: bd876a51-14c1-11e5-94fc-f9606cb38b63
> HELLO FROM CLOJURE :)
> #object[lambdainternal.api.LambdaClientContext 0x63e31ee
> lambdainternal.api.LambdaClientContext@63e31ee]
> END RequestId: bd876a51-14c1-11e5-94fc-f9606cb38b63
> REPORT RequestId: bd876a51-14c1-11e5-94fc-f9606cb38b63 Duration: 1.66 ms
> Billed Duration: 100 ms Memory Size: 512 MB Max Memory Used: 98 MB
> START RequestId: bdf4aa6f-14c1-11e5-a6b0-e9e3f6fa14c8
> HELLO FROM CLOJURE :)
> #object[lambdainternal.api.LambdaClientContext 0x68fb2c38
> lambdainternal.api.LambdaClientContext@68fb2c38]
> END RequestId: bdf4aa6f-14c1-11e5-a6b0-e9e3f6fa14c8
> REPORT RequestId: bdf4aa6f-14c1-11e5-a6b0-e9e3f6fa14c8 Duration: 1.56 ms
> Billed Duration: 100 ms Memory Size: 512 MB Max Memory Used: 98 MB
>
>
> On Tuesday, 16 June 2015 16:46:36 UTC+1, Kyle Sexton wrote:
>>
>> Answering my own question about performance, it looks like almost 14
>> seconds for the Lambda function to run. Doing the math1
>> <#14e006bc5690cdbe_m2mvzzr704.fsf@mocker.org_fn.1> if I were to run this
>> 3000000 times in a month bill would be about $342.56. Probably not the
>> ideal solution for clojure in the cloud just yet. :)
>>
>> START RequestId: 48614bcd-143b-11e5-b2c5-b704df8ab2eb
>> HELLO FROM CLOJURE :)
>> #object[lambdainternal.api.LambdaClientContext 0x26a7b76d 
>> lambdainternal.api.LambdaClientContext@26a7b76d]
>> END RequestId: 48614bcd-143b-11e5-b2c5-b704df8ab2eb
>> REPORT RequestId: 48614bcd-143b-11e5-b2c5-b704df8ab2eb       Duration: 
>> 13680.53 ms   Billed Duration: 13700 ms       Memory Size: 512 MB     Max 
>> Memory Used: 104 MB
>>
>>  Kyle Sexton
>>
>> Footnotes:
>>  Footnotes:
>> 1 <#14e006bc5690cdbe_m2mvzzr704.fsf@mocker.org_fnr.1>
>>
>> Used http://aws.amazon.com/lambda/pricing/ and came up with (* (* (*
>> 13.7 3000000) (/ 512 1024.0)) 0.00001667) where 3000000 is number of
>> times run per month, 13.7 is seconds of billable time, 512 is MB of RAM
>> allocated to the function.
>>
>  --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to