Cross-AZ calls show random latency spikes; `mtr` shows 2% packet loss between two subnets.
AdvancedTroubleshootingLatency
Answer
Likely causes → Packet loss forces TCP retransmissions (initial RTO is around 200 ms–1 s), which shows up as long-tail latency. Causes include an instance hitting its network allowance (PPS or bandwidth), a degraded host, conntrack drops, or a provider network issue.
Diagnose →
mtr -rwzc 200 10.0.2.15
nstat -az | grep -i retrans
ethtool -S eth0 | grep -E 'allowance_exceeded' # ENA: bw_in/bw_out/pps/conntrack
Fix → If *_allowance_exceeded counters grow, move to a larger or network-optimized instance type. If one host is bad, replace the instance. Otherwise open a provider case with the mtr output.
Prevent → Export ENA allowance counters and TCP retransmit rate as metrics, and keep chatty services AZ-local.
More on Latency
p99 latency jumped from 200 ms to 3 s right after a deploy; error rate is flat.BeginnerThe API is slow, the database shows 100% CPU, and the slow query log is full of one query doing a sequential scan.BeginnerA JVM service has latency spikes every 30–60 seconds; GC logs show "Pause Full (G1 Compaction Pause)" taking 4 seconds.IntermediateThe first request after idle takes 5 seconds; Lambda logs show "Init Duration: 4512.33 ms".BeginnerLatency grows with traffic and logs show "QueuePool limit of size 5 overflow 10 reached, connection timed out, timeout 30.00".IntermediateA container uses only 40% of its CPU limit on average, yet latency is high; `container_cpu_cfs_throttled_periods_total` keeps rising.Advanced