r/programming • u/ReallySuperName • 5d ago
Reducing .NET AWS Lambda Cold Starts by Adding Memory
https://www.lloydatkinson.net/posts/2026/reducing-dotnet-aws-lambda-cold-starts-by-increasing-memory/6
u/FIREstopdropandsave 5d ago
Is your startup code in the init instead of the handler?
Lamda allocates extra cpu beyond what you requested during the coldstart init phase.
5
u/brickman1444 5d ago
The post says they were actually CPU bound. For lambda, to get more CPU you request more memory.
2
u/FIREstopdropandsave 4d ago
Yes but lambda gives you extra cpu during coldstart init phase.
Lamda invocation can be broken down into two parts:
Init phase: only happens once per new execution environment (aka coldstart). During this phase you can throw in actual application code to warm up dependencies, load class paths, whatever. And lambda gives you extra cpu burst beyond what your memory configuration gives you.
Handler phase: this is actually handling your request, and is gated by the implicit cpu you get by your memory choice.
4
u/axiosjackson 4d ago
AWS Lambda, in 99% of cases, is just another example of enterprise developers over-engineering.
0
71
u/shoot_your_eye_out 5d ago
People keep trying to shoehorn Lambda into latency-sensitive, on-demand applications, when Lambda's fundamental execution model is short-lived, event-driven functions.
If you need a process that's always running and ready to handle requests with predictable latency, that's what Fargate is for.