News for hackers. Stuff that matters.
Re:Cloud Run – Newest member of our serverless compute stack by dstaley on Tuesday April 09, 2019 @01:51PM (#19617268)
Ah, thanks for the details there! So, given that my Cloud Functions project is a Go app (and would be the exact same code between Functions and Run), if I were to run that in a very minimal container (something like Alpine), I could get roughly the same cold start time as Cloud Functions, but fewer of them since I can respond to multiple requests using the same instance.

I'll probably do some experimentation on my end as well to test. Any suggestion how long I should wait between tests to ensure a cold start on both Cloud Functions and Cloud Run?

Re:Cloud Run – Newest member of our serverless compute stack by stewart27 on Tuesday April 09, 2019 @01:54PM (#19617296)
I think you can force cold starts between your tests by re-deploying your function/container. You could (optionally) leave a small buffer (<1 minute) after the deployment to ensure that traffic has fully migrated.
Re:Cloud Run – Newest member of our serverless compute stack by d_w_b on Tuesday April 09, 2019 @05:02PM (#19618895)
I spoke too soon. The deploy will bring up an instance instead of your first request. To force a cold start, you could set concurrency to '1' and send two concurrent requests. You should see a log entry such as the following when a new instance starts up: "This request caused a new container instance to be started and may thus take longer and use more CPU than a typical request." Alternatively, you could set up an endpoint that shuts down the server (which will shut down the instance - not advised for production code).

As an aside, the "K_REVISION" environment variable is set to the current revision. You can log or return this value to test whether traffic has migrated to a new version (instead of waiting a minute).

Re:Cloud Run – Newest member of our serverless compute stack by d_w_b on Tuesday April 09, 2019 @02:04PM (#19617395)
Yes on both accounts.