AJ Stuyvenberg
@ajs.bsky.social
1.9K followers 240 following 320 posts
AWS Hero Staff Eng @ Datadog Streaming at: twitch.tv/aj_stuyvenberg Videos at: youtube.com/@astuyve I write about serverless minutia at aaronstuyvenberg.com/
Posts Media Videos Starter Packs
ajs.bsky.social
This includes full Datadog tracing/logs/metrics by the way.

There's no compromising on observability, not even cold starts.
ajs.bsky.social
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.
ajs.bsky.social
The faster your cold starts are, the cheaper these will be!
ajs.bsky.social
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.
ajs.bsky.social
Happy Lambda Init Billing day to those who celebrate. Fix your cold starts!
ajs.bsky.social
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.
ajs.bsky.social
That said, I'm excited to share that @Datadog's Serverless monitoring product now supports LWA!

Thanks to Harold and AWS Labs for collaborating with us on the PRs, and huge thanks to Alex Gallotta for driving this work.
ajs.bsky.social
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.
ajs.bsky.social
"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.
Reposted by AJ Stuyvenberg
scylladb.com
Datadog rewrote its AWS Lambda Extension from #Golang to #Rustlang with no prior Rust experience. @ajs.bsky.social will share how they achieved an 80% Lambda cold start improvement along with a 50% memory footprint reduction at our free and virtual #P99CONF. www.p99conf.io?latest_sfdc_...

#ScyllaDB
ajs.bsky.social

In our case the secret is a Datadog API key which isn't required until we actually flush data, so deferring it to that point saves us over 50ms.
ajs.bsky.social
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!
ajs.bsky.social
50% lol was not reading the profile carefully
ajs.bsky.social
By switching to a memory arena, we preallocate a slab of memory and virtually eliminate the linear growth of malloc syscalls, which cuts down kernel mode switches, improving latency.

Thank you profiling (and jemalloc)!
ajs.bsky.social
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.
ajs.bsky.social
Now writing a job to a log and then using a subscription filter to run them async is deeply fucking cursed though omg
ajs.bsky.social
I think OP's intentions were pretty pure until they felt they were mistreated by AWS. So many people end up taking to social media in those instances so in my opinion it was mostly fine.
ajs.bsky.social
cc @quinnypig.com, as I saw this post in your newsletter