Operations 4 min read

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.

Architect's Journey
Architect's Journey
Architect's Journey
What Seven Days of Testing Reveal About TCP Memory Overhead

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.

KernelTCPLinuxnetwork performancesocket memorymemory reclamation
Architect's Journey
Written by

Architect's Journey

E‑commerce, SaaS, AI architect; DDD enthusiast; SKILL enthusiast

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.