Grokking Operating Systems and Networking for Backend Engineers
0% completed
Send and Receive Buffers
conn.sendall(reply[queued:])
That line sends the rest of a 10 MB reply to a client, and on a test server it took 3.00 seconds to return. The network was the loopback interface, which moves gigabytes per second, so the network was not the cause. The client had simply stopped reading for a while, and the server's worker waited with it.
The wait happened at the two kernel buffers that every TCP connection has, one on each side. Their size decides how much data a slow reader can make the server hold, and how fast a fast reader can receive.
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%