Honeycomb has moved the bulk of its query compute from AWS Lambda Functions to Lambda Managed Instances, and says the change cut its cost per hour of customer data queried by about 40% in the US and 56% in Europe compared with April. Query volume grew roughly 30% over the same period. The switch alone didn’t produce those numbers: it took months of tuning.
Why Lambda Functions stopped fitting
Honeycomb began using Lambda Functions in 2019 as mapper workers that read lz4-compressed data from S3. Concurrent workers grew from hundreds to tens of thousands, peak ingest rose about fifteen times to around 6.7 million events per second, and weekly query counts grew about fifty times.
The workload changed shape. Weekly MCP tool calls climbed from tens of thousands in February to more than a million by October. An AI agent chasing an incident sends dozens of wide, long-range queries in a burst. That turned a spiky load into a steady baseline, and Lambda compute plus S3 requests became the largest part of the AWS bill.
Hardware refresh was another problem. Logging the CPU model on every invoke showed about half Graviton2, half Graviton3 and a sliver of Graviton4, while Graviton5 was already available on EC2. The per-core-millisecond premium over EC2 had grown from 3-4x to five to eight times. Billing also covered time spent waiting on S3, and European CPUs were busy only around 40% of the time.
How Lambda Managed Instances work
Lambda Managed Instances run Lambda execution environments on EC2 instances in the customer’s own account, from instance families the customer picks. Teams set a target CPU utilization plus minimum and maximum fleet sizes, and Compute Savings Plans apply, with a management fee of 15% of the on-demand price. A rival plan, an always-on EC2 fleet sized for peaks, would have cost about 3.4 times the Lambda bill.
Setup was easy because the API matches Lambda Functions. The main architectural change was multi-concurrency: up to 16 invokes now share one execution environment of 4.9 vCPU and about 9 GB of memory. That meant forced garbage collection per invoke had to go, memory-pressure handling had to protect fifteen neighbors, and telemetry needed to record how many invokes ran alongside each one.
The utilization trap
A CPU-second on Graviton5 under a Savings Plan costs about 7.5 times less than on Functions. But that assumes every paid CPU stays busy, so break-even is roughly one-seventh utilization. Honeycomb’s first fleets ran at 10-16%, and the net saving started near zero. In the US, cost per hour actually rose after the mid-July switchover.
The autoscaler also adds environments when invokes hit the concurrency cap, even with low CPU, and microbursts kept some environment full all day. European demand varied 33-fold within a day, yet the fleet varied only 7-fold. Cutting maximum fleet sizes for each weekday and weekend peak pushed utilization above 20%.
Routing helped too. Interactive queries try the managed fleet first and retry with jitter before spilling to Functions. A single retry rescued about one in nine throttled invokes. Batch-style jobs queue and wait for a managed slot, and one queue merges up to 64 compatible queries into a shared fetch.
Months of performance engineering
On Functions, trimming CPU didn’t lower the bill. On managed hosts every saved cycle meant fewer hosts. In one month, four engineers opened more than 150 pull requests, mostly on the query path. Tuning for one chip generation alone cut CPU per row by about 19%.
Examples include cutting column presence tracking from about 15% of US Lambda CPU to 2.6%, and matching literal-string regex filters with a plain byte search, which cut each match from 89.9 to 22.6 nanoseconds. The team also moved from lz4 to zstd once Graviton5 made the extra CPU worthwhile, and fixed DNS stalls that had pushed some S3 connections past four seconds.
What this means for other teams
Functions still suits spiky, latency-sensitive work and still catches Honeycomb’s overflow on its busiest days. The company’s advice for others considering the move: know your break-even before starting, measure how many invoke slots are busy rather than trusting averages, and size fleet limits separately for each region and for weekdays and weekends. Choose a cost metric your own optimizations can’t move, check EC2 and EBS quotas, and keep latency-insensitive batch work off Functions.
Source: Honeycomb