portkey

Portkey: from REPL to Serverless in one call
viesti 2018-03-15T07:14:47.000212Z

yeah, the warmup

viesti 2018-03-15T07:14:52.000239Z

Fargate maybe

dominicm 2018-03-15T10:48:22.000149Z

I think it was (ab)using cloudwatch or some kind of health check

alexlynham 2018-03-15T11:27:20.000187Z

at the AWS day the amazon lot said to use cloudwatch to ping as a workaround which was a bit eek

cgrand 2018-03-15T11:30:03.000469Z

Hey, I’ve got a stupid idea!

cgrand 2018-03-15T11:31:13.000011Z

Pinging is vaguely efficient in keeping a small pool active, right?

cgrand 2018-03-15T11:32:14.000220Z

but it fails at preventing cold starts when the pool is depleted, right too?

cgrand 2018-03-15T11:34:43.000344Z

If in each lambda we probabilisticly determine to invoke the lambda again (just for warmup) then we dynamically warm up more instances.

cgrand 2018-03-15T11:36:14.000317Z

@viesti @dominicm @alex.lynham am I nut?

viesti 2018-03-15T11:37:17.000275Z

nut, you, never!

viesti 2018-03-15T11:38:27.000132Z

so haven’t done investigation, but there were some posts that every 4hours the cluster reboots

viesti 2018-03-15T11:38:36.000425Z

so there is at least that kind of cold start

viesti 2018-03-15T11:38:44.000080Z

each deploy is cold start

alexlynham 2018-03-15T11:38:44.000451Z

yeah they randomly bring the lambda instances down every once in a while

alexlynham 2018-03-15T11:39:05.000200Z

so you have cold starts from not being used & cold starts from instances being cycled

viesti 2018-03-15T11:39:10.000399Z

the cold start cycle for cluster reboot starts at lambda creation, I think

viesti 2018-03-15T11:39:44.000104Z

but 👍 for probabilistic warmup

viesti 2018-03-15T11:39:48.000094Z

there’s two uses

viesti 2018-03-15T11:39:50.000365Z

production and repl

viesti 2018-03-15T11:40:00.000191Z

which have different strategies

cgrand 2018-03-15T11:40:03.000233Z

if your lambda is active enough it’s deployed on several containers so on cycling you lose only some of your caapacity, not all

alexlynham 2018-03-15T11:40:13.000093Z

very true

alexlynham 2018-03-15T11:40:40.000425Z

I guess as long as there's at least a small pool at any given time you should be golden

alexlynham 2018-03-15T11:41:59.000324Z

when we used to shuffle around v large volumes in amazon we had to warm things as part of a deployment step so sometimes hacks are needed

alexlynham 2018-03-15T11:42:01.000199Z

¯\(ツ)

cgrand 2018-03-15T12:27:13.000308Z

I’m looking for a reference for this statement > The container is not used for a second invocation until the first one finishes.

dominicm 2018-03-15T14:19:53.000227Z

I read that on hackernoon, they may have a reference.

cgrand 2018-03-15T15:40:53.000893Z

I have written a crude simulator: https://gist.github.com/cgrand/8a57d5761d2c5c5ab5dbec25d5d0c823

cgrand 2018-03-15T15:41:47.000584Z

under constant load (which is the best case for Lambda), the number of perceived cold starts would be almost halved with probabilistic warmup

cgrand 2018-03-15T15:51:09.000010Z

Something beyond the README?

viesti 2018-03-15T15:59:14.000449Z

hmm, at which point does it cost more to keep warm lambdas then to run an on-demand ec2 (cost dependa on instance type)

cgrand 2018-03-15T16:02:25.000620Z

disclaimer: my sim worst sin may be temporal aliasing

dominicm 2018-03-15T17:10:37.000640Z

Yeah. I think you're basically inventing ec2 when you do a warm lambda.

cgrand 2018-03-15T17:11:50.000094Z

There’s a bit more work and integration to do with ec2.

cgrand 2018-03-15T17:13:47.000117Z

When I suggested probabilistic warmup it was to ensure there was always a buffer of ready containers to diminish latency on activity bursts.

dominicm 2018-03-15T17:18:31.000264Z

> work and integration There is? ASGs are fairly well explored. You set them to a minimum of X and you're good to go? Maybe I'm used to the convenience of terraforn/cloudformation managing that stuff

cgrand 2018-03-15T17:32:27.000107Z

yes it’s not about autoscaling it’s about “packaging”

2018-03-15T17:32:53.000614Z

cgrand 2018-03-15T17:34:17.000737Z

/github subscribe portkey-cloud/portkey

cgrand 2018-03-15T17:34:33.000375Z

/github subscribe portkey-cloud/aws-clj-sdk

2018-03-15T19:01:21.000171Z

viesti 2018-03-15T19:11:35.000364Z

hmh, didn’t figure out how to put documentation key into shape: https://github.com/aws/aws-sdk-java/blob/master/aws-java-sdk-models/src/main/resources/models/elasticfilesystem-2015-02-01-model.json#L28

viesti 2018-03-15T19:17:11.000254Z

haa, almost, there are more documentation keys in the maven packaged model

2018-03-15T19:27:03.000482Z

viesti 2018-03-15T19:27:28.000084Z

portkey.awsgen> (generate-files!)
generating “appsync” “2017-07-25"
generating “events” “2015-10-07"
skipping portkey.aws.events.-2015-10-07 protocol “json”
generating “elasticfilesystem” “2015-02-01”
generating “serverlessrepo” “2017-09-08”
ExceptionInfo In: [1 1 “SourceCodeUrl” 1 1 0] val: “locationName” fails at: [:members 1 1 :querystringmap :shape 0] predicate: #{“shape”}

viesti 2018-03-15T19:27:31.000483Z

nearly there

viesti 2018-03-15T19:29:05.000248Z

hum, serverlessrepo appeared quite recently

2018-03-15T19:29:55.000076Z