AJ Stuyvenberg

@ajs.bsky.social

AWS Hero Staff Eng @ Datadog Streaming at: twitch.tv/aj_stuyvenberg Videos at: youtube.com/@astuyve I write about serverless minutia at aaronstuyvenberg.com/

I use AWS a ton but Lambda still astounds me. Throw some code in a function, send 1m requests as fast as you can. It ate up all available file descriptors on my little t3 box and still ran 18k RPS with a p99 of 0.3479s. Not many services can go from 0 to 18k RPS instantaneously with this p99.

BildBild

Lambda now charges for init time, so it's useful to count sandboxes which are proactively initialized but never receive a request. Here's what happens after a 10k request burst. Hundreds of sandbox shutdowns, along with 22 sandboxes which were spun up but never received a request.

Bild

NEW: Lambda can now send up to 200mb payloads using response streaming! I assume this is mostly directed at LLM inference workloads, where chatbots can stream large amounts of data over the wire as it becomes available.

Bild

I've long been an advocate for the Lambda Web Adapter project which lets anyone pretty easily ship an app to Lambda without learning about the event model/API. Honestly AWS should simply support this natively.

Bild

"We run benchmarks continually across all of our competitors, not just queries - even connections, ensuring we don't add any latency at all." @isamlambert Performance is such a competitive advantage which easily slips away if you're not constantly paying attention to it.

Here's another 33% cold start reduction, which comes from deferring expensive decryption calls made to AWS Secrets Manager until the secret is actually needed. Lazy loading is great!

Bild

Here's how to visualize a 100% memory allocation improvement! A recent stress test revealed that malloc calls bottlenecked when sending > 100k spans through the API and aggregator pipelines in Lambda.

BildBild

NEW: A recent blog post went viral in the AWS ecosystem, about how there's a silent crash in AWS Lambda's NodeJS runtime. Today I'll step you through the actual Lambda runtime code which causes this confusing issue, and walk you through how to safely perform async work in Lambda:

Bild

Lambda's fleet management shutdown algorithm is learning faster! I'm calling this function every 8 or so minutes. At first the gap from invocation to shutdown is about 5-6 minutes, which was the fastest I've observed during previous experiments.

Bild

You should care about your p99! By improving the function cold start time, the service on the left performed: 2x faster in RPS and thus, duration. p99 from 1.52s -> .949s The code and functionality is identical, but improving the cold start from 816ms to 301ms made all the difference.

BildBild

Quick PSA to make sure you're using a DLQ and setting a max receive count for SQS, otherwise you may find yourself looking at a flamegraph like this. Hundreds of attempts, multiple messages in queue and not burning down and average age of message ticking up! Seems common knowledge, but...

Bild

Real-time audio processing is an extremely interesting corner of performance engineering. You've gotta process data faster than it streams in, otherwise the work is wasted. The engineering team behind CoScreen just open sourced a new library, dtln-rs, suitable for removing noise from all kinds

How we built a real-time, client-side noise suppression library without server dependencies | Datadog

Learn how we implemented and open-sourced a noise filter for real-time audio chat without compromising performance. Better yet, try the demo and add it to your own project today.

datadoghq.com

Monitoring Lambda sandbox shutdowns reveals an interesting scaling behavior After a request spike, Lambda waits ~10m before reaping 2/3rds of sandboxes. 5m later it begins reaping the rest. Presumably this helps smooth latency during retry storms, or if traffic returns!

Bild

Here's another huge p99 cliff! One unreasonably effective way to lower the average latency of a service is to minimize the causes of p99 events. Here, we've managed to absolutely crush the Max Post Runtime Duration from ~80ms to 500µs!

Bild

PRICE CUT: Lambda slashes the price of cloudwatch logs for high volume. From $.50/gb down to $0.05/gb after 50TB. You've gotta be spending a decent chunk of $$$ on cloudwatch logs for this to help, but still – a price cut is a price cut!

Bild

Combining profiler data with claude code feels super powerful. Just drop a pprof file into a project, explain the dimensions of the profile, then let the LLM make suggestions to solve the hot spots. Instant performance boost

Bild

NEW: AWS Lambda will now begin billing for the INIT phase for all runtimes (not just custom/container runtimes). Your cold starts cost money now! My hottest take is that AWS should have done this years ago.

Bild

🚨 NEW VIDEO: Good clocks could be huge for us devs – so now I've finally made a video about databases, how they are distributed, and why precise clocks can change things. This can also go horribly wrong, so we'll cover that too. Check it out – https://buff.ly/4hhkVtw

Bild

Should you use Lambda Function Warmers in 2025? Probably not! Here's some preliminary data. It's 200 requests at around 20 requests per second (2 runs). The warmer function attempts to create 10 concurrent sandboxes. Notice that the number of cold starts (~75) is the same!

Bild