Search code examples
nginxgunicornwerkzeug

A lot of 408 on nginx due to client body timeout


I am running a backend server with gunicorn behind an nginx 1.6.2 on ubuntu 12.04.

Recently I noticed a lot of 408's in the nginx logs for upload (POST) requests and changing the various timeouts in nginx config I got to know that it was due to client_body_timeout.

Taking tcpDump on the server side it looked like the client is not sending anything after the initial SYN and SYNACK packets and after the client body timeout time the server tries to close the connection by sending FIN ACK, but the client does not ACK and the server goes into its retransmission policy.

Is there anything I am missing or any HTTP header needs to be added or any tcp parameter need to be configured


Solution

  • I found the issue. Took the client side tcpdump n found that only small sized tcp segments were reaching the client. Reduced mss to 1200 and it worked for me :). Don't know if this is the correct approach.