Skip to content

Instantly share code, notes, and snippets.

@stephankoelle
Last active March 20, 2026 07:50
Show Gist options
  • Select an option

  • Save stephankoelle/979e2e27ae11aff331ca3674b8ec7bad to your computer and use it in GitHub Desktop.

Select an option

Save stephankoelle/979e2e27ae11aff331ca3674b8ec7bad to your computer and use it in GitHub Desktop.
debug socket issue

netstat -s | grep -E "pruned|collapsed"
166 packets pruned from receive queue because of socket buffer overrun
8 packets pruned from receive queue
1787 packets collapsed in receive queue due to low socket buffer

nstat -az | grep -i listen
Fri Mar 20 07:49:54 UTC 2026
TcpExtListenOverflows 3748 0.0
TcpExtListenDrops 3748 0.0
TcpExtTCPFastOpenListenOverflow 0

130 packets pruned from receive queue because of socket buffer overrun
8 packets pruned from receive queue
1040 packets collapsed in receive queue due to low socket buffer

Increase max OS-level buffer to 64MB (or 128MB: 134217728)
net.core.rmem_max = 67108864
net.core.wmem_max = 67108864

Increase default buffer to 1MB (helps high-concurrency start faster)
net.core.rmem_default = 1048576
net.core.wmem_default = 1048576

TCP specific (Max should match net.core.rmem_max)
format: min default max net.ipv4.tcp_rmem = 4096 1048576 67108864
net.ipv4.tcp_wmem = 4096 1048576 67108864

Enable TCP Window Scaling (Critical for buffers > 64KB)

net.ipv4.tcp_window_scaling = 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment