Buffering issues with nginx

Dan34 nginx-forum at forum.nginx.org
Mon Jul 24 16:24:43 UTC 2017


I did some logs on my proxy test and compared results with wireshark trace
at some random point in time (t=511sec)
And numbers match exactly between logs and wireshark. 

This is a log line from my test proxy:
time: 511s, bytesSent:5571760, down:{ SND:478720 OUTQ:280480 } up:{
RCV:5109117 INQ:3837047 }
SND is SNDBUF, RCV is RCVBUF, OUTQ is SIOCOUTQ, INQ is SIOCINQ/FIONREAD.
down is the link between wget and proxy, and up is the link from proxy to
node on localhost.

At the same time in wireshark the up link has 9409056 bytes ACKed, down link
has 5291529 bytes ACKed, or 9409056-5291529=4117527 bytes got accumulated
inside proxy process. This is exactly the same number of bytes that's stuck
in socket queues on up+down links (280480 + 3837047 =4117527).

>From logs it also looks like when INQ and OUTQ reach values close to SND/RCV
then in wireshark I see TCP packets with window size = 0 to stop any
transmission.
Perhaps, if I set SND+RCV to 64K then total buffering should not exceed
128KB inside proxy buffers.

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,275526,275640#msg-275640



More information about the nginx mailing list