3 ms·
Slightly OT, but I have a question on AWS Lambda(s) since they run on Firecracker MicripoVM(s): have somebody found a way to reduce cold-starts times? Online I
by tatoalo 4y ago
Slightly OT, but I have a question on AWS Lambda(s) since they run on Firecracker MicripoVM(s): have somebody found a way to reduce cold-starts times?
Online I was only able to find that the way to go seems to be to produce an heartbeat on a rolling schedule, wanted to look into this.
- santiagobasulto 4y agoThe solution for cold starts is usually keeping them warm :) In Lambdas, you can schedule a cloudwatch event similar to the heartbeat you've mentioned.
- devoutsalsa 4y agoDumb question. How is keeping a lambda warm different than just running a VM? Does the warm lambda instance respond quickly, and when it starts getting saturated, then additional Lambdas come online via a cold start process?
- santiagobasulto 4y agoI use Zappa, it just schedules a frequent execution of the lambda: https://github.com/zappa/Zappa#keeping-the-server-warm https://github.com/zappa/Zappa#keeping-the-server-warm
- vegardx 4y agoBut what devoutsalsa said is true, you will still get a cold start when a request comes in while the already "warm" lambda is processing another request. This is one of the gotchas that not everyone seem to understand about these cloud functions. Sure, you'll scale quite horizontally, but just one executor at the time. If you have a long cold start, this can significantly increase latency. Some providers let you pay for concurrency, so that you can scale out more quickly.
- JoshTriplett 4y agoWhat runtime are you using? A custom runtime can get cold start times in milliseconds, as long as you're not loading a large language runtime or a container. Try a custom runtime that has only a single statically linked binary in it and nothing else.
- tatoalo 4y agoI am using a Python runtime