nginx 1.4.1 - slow transfers / connection resets

Philip Hofstetter phofstetter at
Mon Aug 19 12:07:09 UTC 2013


I have a nginx (stock ubuntu config) as a reverse proxy in front of  a
haproxy in front of 5 more nginx machines which use fastcgi to talk to

My issue is with the frontend proxy and long-running, veeeeery
slowwwww requests.

The clients are very underpowered mobile barcode scanners using 2G GSM
connections. When they try to download 2.1 MB of data dynamically
generated by PHP on the back, backend, the Frontend will close the
connection after ~1MB has been downloaded (at ~2 KBytes/s).

I can reproduce the same behavior using curl (with --rate-limit 2K):

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1196k    0 1196k    0   343   2047      0 --:--:--  0:09:58 --:--:--  1888
curl: (56) Recv failure: Connection reset by peer

The access log on the frontend server lists a 200 status code but too
few transmitted bytes.

The error log (on info) shows

2013/08/19 14:03:36 [info] 32469#0: *1166 client timed out (110:
Connection timed out) while sending to client, client:

Which is not true - it's showing that while curl (--rate-limit 2K) ist
still running.

Can you give me any pointers in how to debug/fix this?


Sensational AG
Giesshübelstrasse 62c, Postfach 1966, 8021 Zürich
Tel. +41 43 544 09 60, Mobile  +41 79 341 01 99
info at,

More information about the nginx mailing list