What Seven Days of Testing Reveal About TCP Memory Overhead
After a week-long series of experiments measuring TCP connections in various states—including ESTABLISH, client‑to‑server, server‑to‑client, and non‑ESTABLISH scenarios—the author quantifies per‑connection memory usage and shows how modern kernels reclaim buffers and reduce overhead, especially for TIME_WAIT.
Experiment 1: ESTABLISH (Idle) Connections
Experiment 2: Client → Server Data Transfer
Experiment 3: Server → Client Data Transfer
Experiment 4: Non‑ESTABLISH States (e.g., TIME_WAIT)
Summary
The experimental data show that the kernel employs several optimizations to reduce socket memory consumption:
The kernel promptly reclaims send and receive buffers; newer kernel versions perform this reclamation more aggressively.
The actual minimum size of send/receive buffers can be smaller than the rmem_min kernel parameter.
In states such as TIME_WAIT, the kernel also frees unnecessary objects like socket_alloc.
These findings help developers understand the memory footprint of TCP connections under realistic workloads and guide tuning of kernel parameters for better resource utilization.
Architect's Journey
E‑commerce, SaaS, AI architect; DDD enthusiast; SKILL enthusiast
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
