Before applying any test load, record memory and table occupancy during normal activity. Use only a small, stoppable workload on a client you control.
Locate the backlog by client and protocol
Read /proc/sys/net/netfilter/nf_conntrack_count and nf_conntrack_max. Match the log timestamp to busy clients, long-idle sessions and an application connection failure. Check available memory, slab usage and CPU before increasing the limit.
Pause the identified source or stop the test. Try a fresh application connection as the count falls. If the failure persists despite a lower count, check DNS, the link and the service. Avoid flushing established connections. If you change the maximum, recheck memory and reclamation.
Inspect terminal output

Why is the connection tracking table growing? Compare live traffic, timeouts and memory
The connection table hasn't decreased yet, even though the download tasks have finished. Linux may continue to retain state for some already-closed flows. To determine whether the router is truly under pressure, you need to assess the current table occupancy, connection states, system headroom, and whether a new session can be successfully established.
On the router handling this traffic, read the following items via SSH before and after the fault occurs. If containers or network namespaces are present, read the count, max, and each state from the same network namespace. When a fault is already present, use a lower-overhead counter first; on busy devices, repeatedly listing the full table may affect responsiveness.
cat /proc/sys/net/netfilter/nf_conntrack_count
cat /proc/sys/net/netfilter/nf_conntrack_max
cat /proc/sys/net/netfilter/nf_conntrack_tcp_timeout_time_wait
grep -E '^(MemAvailable|Slab|SUnreclaim):' /proc/meminfo
logread | grep -F 'nf_conntrack: table full' | tail -5
count is the current number of allocated tracking entries, including TCP, UDP, and others. max is the upper limit; the ratio of count to max does not represent memory usage. MemAvailable is an estimated value of available memory across the entire system. If the kernel exports /proc/slabinfo, the number of active objects, object size, and total object count corresponding to nf_conntrack can be read from it; note the scope of statistics, allocation overhead, and other slab caches. Observing only slab growth does not necessarily indicate connection tracking usage.
What happens to the two TCP entries after the connections close?
Isolation test: two client process instances access a dedicated TCP port 18052, each sending a string. The receiver echoes the string, maintains the connection, and then the test client normally terminates. In the svc52 network namespace responsible for handling the echo, run the following consistently before and after:
ip netns exec svc52 conntrack -L -p tcp --dport 18052
ip netns exec svc52 cat /proc/sys/net/netfilter/nf_conntrack_count

First, two ESTABLISHED entries are observed, and after termination, two TIME_WAIT entries are still found for the same destination port. The total count dropped from 17 to 7 in this round, and additionally, connections on other ports are not included in the filtered results; the two test connections did not cause the count to increase by two as expected, and the entries can still be independently identified by port, state, and echo. This round only validates the connection lifecycle within the software—no tests on maximum concurrency, connections per second, or device performance were conducted.
| The seen combinations | Next step |
|---|---|
| Increased active traffic and corresponding growth in ESTABLISHED connections; new connections established successfully with memory still available | Record the state distribution after the end of the same business, and compare under identical loads and time periods. Narrow the scope by client or known port. |
| Large numbers of short-lived connections leave behind TIME_WAIT | Check the actual timeout value under this state. After stopping the controlled flow, perform sampling with a delay, and wait for the same five-tuple to naturally disappear. When the overall counter remains active, the total count cannot be used to determine whether the flow has expired. |
| Near capacity limit, encountering table full and new test connections failing | Log the failure time, table upper limit, and whether existing sessions are normal. First pause any confirmed abnormal services, then establish a new connection using the same endpoint. When increasing the upper limit, consider the total system memory; retain the original value by default. |
| count moves away from the limit, MemAvailable continues to decrease or OOM occurs | Verify process anonymous memory, other kernel allocations, and kernel logs. The absence of "table full" does not rule out other causes leading to new connection failures. |
Close the test client after reading and experiments are completed; production connections will naturally expire. Clearing the entire table will interrupt business processes that depend on the existing state; fault diagnosis does not require validation through this step.How to distinguish local receive and transmit from forwarding through a router?
Comments