Lab
The accept queue
A program calls listen(2) with a The length of the accept queue that a program asks for in listen(2). The queue keeps each connection that the program did not accept., and the kernel keeps each new connection in the accept queue until the program accepts it. When the program stops its accepts, the queue fills. A full queue drops a SYN with no answer, and it drops the final ACK of a handshake. This page computes, in your browser, how many connections the queue holds, and how each connect ends.
The queue holds 5 connections. At 30 ms, the final ACK of connect 2 overflows, but the client is connected. The client stays connected to nothing.
The settings of the cell AQ.5: a queue of 5 with 4 in it, and a burst of three connects. The client sends nothing.
- the fault
- the lane acts, in this band
- recovers
- a send again or a timer
- a probe
- measured median of a cell
The axis is logarithmic, thus the first second and the last hour both fit.
The accept queueThe length of the accept queue that a program asks for in listen(2). The queue keeps each connection that the program did not accept.
First · Knows at 30 mslisten(2) gets 4, thus the queue holds 5. The first overflow comes at 30 ms: the final ACK of connect 2.
- listen(2) gets
- 4
- The limit, after somaxconn
- 4
- A full queue holds
- 5
- In the queue at 0 s
- 4
- New connects that find a place
- 1
- SYNs that drop
- 0
- Final ACKs that overflow
- 2
listen(2) getsThe length of the accept queue that a program asks for in listen(2). The queue keeps each connection that the program did not accept.A sysctl: the largest backlog. A larger backlog in listen(2) gets this value. The default is 4096.In the queue at 0 sNew connectsThe connects comeThe program acceptsA SYN at a full queueA sysctl: the count of SYNs that a connect sends again before ETIMEDOUT. The default 6 gives 131 s.
Never knowsNo SYN finds the queue full.
- tcp_syn_retries
- 6
- tcp_syn_linear_timeouts
- 4
The clock of the kernel: the ticks in each second. A timer fires on a tick, thus it can be late by one tick or more.A final ACK at a full queueA sysctl: 1 answers a final ACK at a full queue with a reset. The default 0 drops the ACK and keeps the request.
Cannot see itThe client is connected at 20 ms, but its final ACK overflows. The target forgets the request at 63.01 s. The client sends nothing, thus it stays connected to nothing.
- The client is connected at
- 20 ms
- SYN-ACKs that go again
- 5
- The target forgets the request at
- 63.004 s to 64.738 s
- The first send of the client
- none
- tcp_abort_on_overflow
- 0
- tcp_synack_retries
- 5
A sysctl: 1 answers a final ACK at a full queue with a reset. The default 0 drops the ACK and keeps the request.The client sends
How to read the page
Section titled “How to read the page”- The headline tells the first overflow of the queue and how its connect ends.
- The timeline has three lanes. The queue lane shows when the queue is full and the first overflow. The SYN lane follows the first connect whose SYN drops. The final ACK lane follows the first connect whose final ACK drops. Press Play to see the story.
- The cards below the timeline give each lane, with its knobs. Change a knob, and each time on the page changes.
- The presets are the settings of the cells AQ.1 to AQ.10 of the harness.
- The measured values below give each cell as the runners of GitHub measured it. Each row is one term of the law, with its band and its median.
The law of the count
Section titled “The law of the count”listen(2) clamps the backlog to A sysctl: the largest backlog. A larger backlog in listen(2) gets this value. The default is 4096., and this value is the limit of the queue. A full queue holds the limit plus one, because the kernel tests for more than the limit. Thus a backlog of 4 holds 5 connections, and a backlog of 0 holds 1.
Node gives listen(2) 511 for a backlog of 0. Thus a server on Node that declares 0 holds 512 connections.
Two kinds of overflow
Section titled “Two kinds of overflow”- A SYN at a full queue drops with no answer. The client sends its SYN again on its ladder: 1 s for each of the first five waits, then 2, 4, 8, 16, 32 and 64 s. With A sysctl: the count of SYNs that a connect sends again before ETIMEDOUT. The default 6 gives 131 s. 6, the connect ends with The error that the kernel gives to the socket when TCP stops a connection on a timer. at 131 s.
- A final ACK at a full queue comes after the client is connected. With A sysctl: 1 answers a final ACK at a full queue with a reset. The default 0 drops the ACK and keeps the request. 1, the target sends a reset, and the client gets The error that the kernel gives to the socket when a reset from the peer ends the connection. one round trip later.
- With tcp_abort_on_overflow 0, the target drops the ACK and keeps the request. It sends its The answer of the target to a SYN, the second packet of the handshake. again at 1, 3, 7, 15 and 31 s. At 63 s it forgets the request.
After the expiry, the next segment of the client meets the listener, and it gets a reset. A client that sends nothing stays connected to nothing. When the program accepts before the expiry, the next SYN-ACK gets a The answer of a connected client to a SYN-ACK that comes again: an ACK that tells the target the state of the client. from the client, and that ACK finds a place.
The measured values
Section titled “The measured values”Each cell fills a real queue on a runner of GitHub, and the harness measures each term of its law. The band of a term is the prediction of the cell. The median is the middle value of the counted trials. A median outside its band shows as a failure. A cell with no record keeps its place.
The runners of GitHub measured these cells on 2026-11-16, on the kernel 7.0.0 with HZ 1000, at the commit 43219db.
listen(2) clamps the backlog to somaxconn, and the queue holds the limit plus one. Each later SYN is one overflow.
None of the 4 counted runs measured a time.
| Term | Band | Median | Trial 1 | Trial 2 | Trial 3 | Trial 4 |
|---|---|---|---|---|---|---|
| the limit of the queue | 4 | 4 | 4 | 4 | 4 | 4 |
| the most in the queue | 5 | 5 | 5 | 5 | 5 | 5 |
| the connects that succeed | 5 | 5 | 5 | 5 | 5 | 5 |
| the overflows | 2 | 2 | 2 | 2 | 2 | 2 |
| the resets of the target | 0 | 0 | 0 | 0 | 0 | 0 |
listen(2) clamps the backlog to somaxconn, and the queue holds the limit plus one. Each later SYN is one overflow.
None of the 4 counted runs measured a time.
| Term | Band | Median | Trial 1 | Trial 2 | Trial 3 | Trial 4 |
|---|---|---|---|---|---|---|
| the limit of the queue | 8 | 8 | 8 | 8 | 8 | 8 |
| the most in the queue | 9 | 9 | 9 | 9 | 9 | 9 |
| the connects that succeed | 9 | 9 | 9 | 9 | 9 | 9 |
| the overflows | 2 | 2 | 2 | 2 | 2 | 2 |
| the resets of the target | 0 | 0 | 0 | 0 | 0 | 0 |
listen(2) clamps the backlog to somaxconn, and the queue holds the limit plus one. Each later SYN is one overflow.
None of the 4 counted runs measured a time.
| Term | Band | Median | Trial 1 | Trial 2 | Trial 3 | Trial 4 |
|---|---|---|---|---|---|---|
| the limit of the queue | 0 | 0 | 0 | 0 | 0 | 0 |
| the most in the queue | 1 | 1 | 1 | 1 | 1 | 1 |
| the connects that succeed | 1 | 1 | 1 | 1 | 1 | 1 |
| the overflows | 2 | 2 | 2 | 2 | 2 | 2 |
| the resets of the target | 0 | 0 | 0 | 0 | 0 | 0 |
The kernel drops each SYN at a full queue with no answer. Each of the 11 SYNs is one overflow, and the connect ends on the timer of the client.
None of the 4 counted runs measured a time.
| Term | Band | Median | Trial 1 | Trial 2 | Trial 3 | Trial 4 |
|---|---|---|---|---|---|---|
| the limit of the queue | 1 | 1 | 1 | 1 | 1 | 1 |
| the most in the queue | 2 | 2 | 2 | 2 | 2 | 2 |
| the connects that succeed | 2 | 2 | 2 | 2 | 2 | 2 |
| the overflows | 11 | 11 | 11 | 11 | 11 | 11 |
| the resets of the target | 0 | 0 | 0 | 0 | 0 | 0 |
| ETIMEDOUT at the blocked connection | 130.99 s to 137.09 s | 134.51 s | 134.44 s | 134.59 s | 134.88 s | 134.04 s |
tcp_abort_on_overflow 0 keeps the request and drops the final ACK. The client is ESTABLISHED, and only a later segment tells it the truth. The count of overflows depends on the retransmissions of the client, thus it has a floor and no band.
None of the 4 counted runs measured a time.
| Term | Band | Median | Trial 1 | Trial 2 | Trial 3 | Trial 4 |
|---|---|---|---|---|---|---|
| the limit of the queue | 4 | 4 | 4 | 4 | 4 | 4 |
| the most in the queue | 5 | 5 | 5 | 5 | 5 | 5 |
| the connects that succeed | 7 | 7 | 7 | 7 | 7 | 7 |
| the overflows | 2 to 1,000 | 22 | 22 | 22 | 22 | 22 |
| the resets of the target | 0 | 0 | 0 | 0 | 0 | 0 |
| the expiry of the requests | 62.98 s to 64.74 s | 64.08 s | 63.83 s | 64.09 s | 64.3 s | 64.06 s |
| ECONNRESET at the busy connection | 110 s to 125 s | 115.92 s | 117.6 s | 114.29 s | 117.56 s | 114.25 s |
| ECONNRESET at the quiet connection | 0.01 s to 0.05 s | 0.02 s | 0.02 s | 0.02 s | 0.02 s | 0.02 s |
tcp_abort_on_overflow 1 answers an overflow of a final ACK with a reset. A SYN at a full queue stays silent, because the sysctl does not change that path.
None of the 4 counted runs measured a time.
| Term | Band | Median | Trial 1 | Trial 2 | Trial 3 | Trial 4 |
|---|---|---|---|---|---|---|
| the limit of the queue | 4 | 4 | 4 | 4 | 4 | 4 |
| the most in the queue | 5 | 5 | 5 | 5 | 5 | 5 |
| the connects that succeed | 7 | 7 | 7 | 7 | 7 | 7 |
| the overflows | 3 | 3 | 3 | 3 | 3 | 3 |
| the resets of the target | 2 | 2 | 2 | 2 | 2 | 2 |
| ECONNRESET at the busy connection | 0.01 s to 0.05 s | 0.02 s | 0.02 s | 0.02 s | 0.02 s | 0.02 s |
| ECONNRESET at the quiet connection | 0.01 s to 0.05 s | 0.02 s | 0.02 s | 0.02 s | 0.02 s | 0.02 s |
The request stays until its expiry. The SYN-ACK at 3 s gets a challenge ACK, and that ACK finds a place. The blocked SYN finds a place at its next firing. The count of overflows depends on the retransmissions before the accept, thus its band is wide.
None of the 4 counted runs measured a time.
| Term | Band | Median | Trial 1 | Trial 2 | Trial 3 | Trial 4 |
|---|---|---|---|---|---|---|
| the limit of the queue | 4 | 4 | 4 | 4 | 4 | 4 |
| the most in the queue | 5 | 5 | 5 | 5 | 5 | 5 |
| the connects that succeed | 8 | 8 | 8 | 8 | 8 | 8 |
| the overflows | 9 to 15 | 12 | 12 | 12 | 12 | 12 |
| the resets of the target | 0 | 0 | 0 | 0 | 0 | 0 |
| the accepts | 8 | 8 | 8 | 8 | 8 | 8 |
| the queue back to 4 | 3.01 s to 3.16 s | 3.08 s | 3.08 s | 3.08 s | 3.14 s | 3.07 s |
listen(2) clamps the backlog to somaxconn, and the queue holds the limit plus one. Each later SYN is one overflow.
None of the 4 counted runs measured a time.
| Term | Band | Median | Trial 1 | Trial 2 | Trial 3 | Trial 4 |
|---|---|---|---|---|---|---|
| the limit of the queue | 4 | 4 | 4 | 4 | 4 | 4 |
| the most in the queue | 5 | 5 | 5 | 5 | 5 | 5 |
| the connects that succeed | 5 | 5 | 5 | 5 | 5 | 5 |
| the overflows | 2 | 2 | 2 | 2 | 2 | 2 |
| the resets of the target | 0 | 0 | 0 | 0 | 0 | 0 |
listen(2) clamps the backlog to somaxconn, and the queue holds the limit plus one. Each later SYN is one overflow.
None of the 4 counted runs measured a time.
| Term | Band | Median | Trial 1 | Trial 2 | Trial 3 | Trial 4 |
|---|---|---|---|---|---|---|
| the limit of the queue | 8 | 8 | 8 | 8 | 8 | 8 |
| the most in the queue | 9 | 9 | 9 | 9 | 9 | 9 |
| the connects that succeed | 9 | 9 | 9 | 9 | 9 | 9 |
| the overflows | 2 | 2 | 2 | 2 | 2 | 2 |
| the resets of the target | 0 | 0 | 0 | 0 | 0 | 0 |
Node gives listen(2) 511 for a backlog of 0, thus the declared 0 of service 0.7.3 is a limit of 511. The queue holds the limit plus one, and each later SYN is one overflow.
None of the 4 counted runs measured a time.
| Term | Band | Median | Trial 1 | Trial 2 | Trial 3 | Trial 4 |
|---|---|---|---|---|---|---|
| the limit of the queue | 511 | 511 | 511 | 511 | 511 | 511 |
| the most in the queue | 512 | 512 | 512 | 512 | 512 | 512 |
| the connects that succeed | 512 | 512 | 512 | 512 | 512 | 512 |
| the overflows | 2 | 2 | 2 | 2 | 2 | 2 |
| the resets of the target | 0 | 0 | 0 | 0 | 0 | 0 |
Where the numbers come from
Section titled “Where the numbers come from”The count is the law of acceptQueueLimit and acceptQueueHeld of @mark1russell7/algebra. The ladders come from the timers of the document of Linux TCP, LINUX_TCP of @mark1russell7/machines: syn_retransmit, syn_giveup, synack_retransmit, synack_giveup and retransmit.
Each timer fires on a tick of The clock of the kernel: the ticks in each second. A timer fires on a tick, thus it can be late by one tick or more., thus each firing can come late. The band of a time on the page is the sum of how early and how late each wait before it can fire. Each amount prints through format of @mark1russell7/quantity. The page does no timer arithmetic of its own.
Limits
Section titled “Limits”- The page puts one half of the round trip on each way of the path.
- From the accept, the page gives a place to each packet. A program that accepts slowly frees one place for each accept.
- When the queue of requests is full, the target sends a An answer to a SYN when the queue of requests is full. The target keeps no request and finds the connection in the final ACK.. The page counts the cookie, but it does not show its later steps.
- A client that sends data stops after A sysctl: the number of RTO retransmissions before TCP stops the connection. The default is 15, approximately 15 min.. The page shows the first segment after the expiry, which comes well before that end.