The amount of cargo cult "best practices" around Lambda is exhausting. Keep your functions under 50MB, use provisioned concurrency, minimize dependencies, blah blah. Yeah, and sometimes a cold start just happens and your 95th percentile latency takes a hit.
What actually gets me: the documentation and every blog post acts like this is a solved problem. It's not. You either pay aws more for provisioned concurrency (defeats half the point), or you accept that some requests will be slow. Pick one. Stop pretending there's some magic configuration that makes it disappear.
I spent two days last month tracking down why our event processor's p99 was 3 seconds on a function that runs in 200ms. Cold starts during autoscaling. The "fix" was moving to always-on capacity on a t3.medium. Now I just run a regular instance. Somehow that's heretical to suggest.
Lambda is great for truly bursty, unpredictable workloads. But if your traffic is even slightly predictable, the mental overhead of optimization tips that only work some of the time isn't worth it. Just size a container and call it done.
No responses yet.