This is very interesting, thanks for sharing this!
Devin Bhushan

The one log stream per container is consistent with what I observe too, but because you can have concurrent invocations of the same function it’s hard to tell cold starts from scaling up (Lambda scales up automatically) by no. of log streams alone. Remember, with Lambda, concurrency has largely moved out into the infrastructure which is a nice feature of the new serverless paradigm.

The system-under-test function is this guy — it detects a cold start by checking if a global variable is set to true (which it’s set on the first invocation).

I used Nodejs for the experiment, I’d expect the recycling behaviour to be the same across different language run times as I’d have thought it’s a character of the scheduler. The experiment is fairly simple to replicate, so feel free to replicate the experiment in Python and let me know what you find! If you do, I’ll rerun my Nodejs experiment too so we can eliminate the possibility that the underlying platform has changed (my experiment is several weeks old by now and predates the Lambda outage 2 weeks ago).

Like what you read? Give Yan Cui a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.