nginx -s reload terminates connections
rlx01
nginx-forum at forum.nginx.org
Fri Jul 7 02:43:44 UTC 2017
Hi,
Using the official 1.12.0 package on debian 9 and the 1.12.0 ports package
on FreeBSD 11-RC1, calling nginx -s reload drops connections.
It's fairly easy to reproduce, I just install the fresh package from
wherever, and serving the default index.html, I run wrk, and in the middle
of the run I call 'nginx -s reload' without actually changing anything:
$ wrk -d 30 -c 100 -t 20 http://nginx-test01.lan/
Running 30s test @ http://nginx-test01.lan/
20 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 10.06ms 4.10ms 53.02ms 79.07%
Req/Sec 503.04 161.36 757.00 53.20%
300801 requests in 30.05s, 243.82MB read
Socket errors: connect 0, read 100, write 0, timeout 0
Requests/sec: 10008.67
Transfer/sec: 8.11MB
You can see 100 socket read errors in this example.
I tried this with the h2o (2.2.2) server just to see what happens and there
is no error:
$ wrk -d 30 -c 100 -t 20 http://h2o-test01.lan/
Running 30s test @ http://nginx-test01.lan/
20 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 4.06ms 1.83ms 56.08ms 76.57%
Req/Sec 1.24k 724.32 6.61k 97.67%
741569 requests in 30.02s, 599.01MB read
Requests/sec: 24699.67
Transfer/sec: 19.95MB
--
The same issue occurs when I test HTTP/2 with 'h2load'. The h2load test just
stops as soon as I call 'nginx -s reload'.
Is this expected behaviour? If so, is there some configuration directive
that would fix it?
In my real world usage, I have a nginx server running on the edge and it
proxies (HTTP/1.1) to a different nginx server. If I call 'nginx -s reload'
on the internal nginx the external nginx shows "upstream prematurely closed
connection while reading response header from upstream" if it's under heavy
load.
Thanks!
Posted at Nginx Forum: https://forum.nginx.org/read.php?2,275328,275328#msg-275328
More information about the nginx
mailing list