Skip to content

nf_conntrack: table full, dropping packet – connections get lost

Linuxtested on Ubuntu 24.04, Kernel 6.8

The web server shows no errors and the CPU is almost idle – yet with short connections it only manages a few requests per second. The kernel log names the reason: the table in which the kernel tracks every connection is full.

Symptom

wrk -t2 -c20 -d60s --timeout 5s -H "Connection: close" http://perf1/
  2 threads and 20 connections
  2043 requests in 1.00m, 1.67MB read
Requests/sec:     34.01

Every request opens a new connection, like many short API calls. Only 34 requests per second, although each successful request takes just 2 ms.

Diagnosis

Read the kernel log and compare the table with its limit.

sudo dmesg -T | grep -i conntrack
[Mon Nov 30 14:37:01 2026] nf_conntrack: nf_conntrack: table full, dropping packet
[Mon Nov 30 14:37:01 2026] nf_conntrack: nf_conntrack: table full, dropping packet

sysctl net.netfilter.nf_conntrack_count net.netfilter.nf_conntrack_max
net.netfilter.nf_conntrack_count = 1993
net.netfilter.nf_conntrack_max = 2048

Causes

nf_conntrack_max = 2048Limit too small for the connection rate

The limit was set to 2,048 by hand. The default depends on main memory and was 262,144 on this VM.

TIME_WAITClosed connections stay in the table

Almost all entries are in TIME_WAIT – connections closed long ago that conntrack keeps for another 120 seconds. With short connections they pile up faster than they expire.

sudo conntrack -L
tcp      6 53 TIME_WAIT src=172.16.0.228 dst=172.16.0.126 sport=47298 dport=80 src=172.16.0.126 dst=172.16.0.228 sport=80 dport=47298 [ASSURED] mark=0 use=1

ct state newA rule turns conntrack on in the first place

A "small counting rule" asks for the connection state. That makes the kernel load nf_conntrack and track every connection in the table.

sudo nft list table inet zaehler
table inet zaehler {
	chain eingang {
		type filter hook input priority filter; policy accept;
		ct state new counter packets 447118 bytes 26842512
	}
}

drop=334Drops happen on the CPU with the receive interrupts

conntrack -S counts dropped packets per CPU – here all on CPU 2.

sudo conntrack -S
cpu=2   	found=0 invalid=0 insert=0 insert_failed=0 drop=334 early_drop=0 error=0 search_restart=0 clash_resolve=0 chaintoolong=0

Fix

Set a suitable limit and check under load.
sudo sysctl -w net.netfilter.nf_conntrack_max=262144
wrk -t2 -c20 -d30s --timeout 5s -H "Connection: close" http://perf1/
  133967 requests in 30.08s, 109.49MB read
Requests/sec:   4453.26

Don't: Multiply the limit blindly. Rule of thumb – new connections per second times entry lifetime, with headroom – and persist it in /etc/sysctl.d/.

▶
Break it yourself and find it – free
Linux system performance hands-on, day 12: interrupts, queues and conntrack – measuring network saturation and finding a full table.
Go to day 12 →

FAQ

How do I know how large nf_conntrack_max has to be?

Watch nf_conntrack_count under load. In the course it settled at about 14,100 entries at 4,450 connections per second; the limit needs plenty of headroom above that.

Why is conntrack active although I have no firewall?

Any rule that checks connection state (ct state, NAT, Docker, Kubernetes) loads nf_conntrack. lsmod shows the module.

Related error patterns

More