Field Note: The Security Group That Ate the Latency Budget

Field Note — one real failure, the wrong diagnosis, the actual cause, the fix.

A change that touched no application code doubled our tail latency overnight. The service dashboards were innocent, which is exactly why it took two days to find. The latency budget was being spent somewhere no service metric was looking: the network path.

The symptom

p99 latency on a chatty internal service jumped from comfortable to alarming with no deploy, no traffic spike, and no change in error rate. CPU, memory, and garbage collection all looked normal. Throughput was steady. Only the tail had moved — and it had moved hard.

The wrong diagnosis

“It’s a GC pause” or “the database is slow.” Both were investigated, both came back clean. When every component reports healthy and the aggregate is sick, the problem is almost always in the space between the components — the part no single service owns.

The actual cause

A security group change, applied through the normal reviewed pipeline, had tightened a rule in a way that forced traffic between two services onto a path through a different availability zone. Each request that used to stay within a zone now paid a cross-zone round trip — a millisecond or two per hop, multiplied by a service that makes many small calls per request. Nothing was broken. Every packet arrived. The bill was paid entirely in latency, and only at the tail, where the extra hops stacked up. The change was correct from a security standpoint and invisible from every application dashboard.

The fix

First, restore locality: keep services that talk to each other constantly in the same zone, and make that placement explicit in code rather than incidental. Second, measure the path, not just the endpoints — network round-trip time between dependent services belongs on the same dashboard as application latency. Third, treat network and security changes as latency changes, because that is what they are; a security group diff deserves the same performance scrutiny as an application diff.

# The service dashboard said "fine." The path said otherwise.
# Same-zone RTT:  ~0.1 ms
# Cross-zone RTT: ~1-2 ms
# x N internal calls per request, it lands entirely in the tail.
#
# Watch: inter-service RTT, cross-AZ byte counts, conntrack table use.
# A security-group diff is a performance change. Review it as one.

The reframe

Your latency budget is spent in places your service dashboard will never show you. The network is part of your latency SLO whether or not you measure it — and a security group is infrastructure code that can quietly rewrite your performance while every application metric swears nothing changed.

Comments

Leave a Reply