Mercurial > hg > nginx-quic
annotate conf/nginx.conf @ 7281:bd6563e81cea
Limit req: improved handling of negative times.
Negative times can appear since workers only update time on an event
loop iteration start. If a worker was blocked for a long time during
an event loop iteration, it is possible that another worker already
updated the time stored in the node. As such, time since last update
of the node (ms) will be negative.
Previous code used ngx_abs(ms) in the calculations. That is, negative
times were effectively treated as positive ones. As a result, it was
not possible to maintain high request rates, where the same node can be
updated multiple times from during an event loop iteration.
In particular, this affected setups with many SSL handshakes, see
http://mailman.nginx.org/pipermail/nginx/2018-May/056291.html.
Fix is to only update the last update time stored in the node if the
new time is larger than previously stored one. If a future time is
stored in the node, we preserve this time as is.
To prevent breaking things on platforms without monotonic time available
if system time is updated backwards, a safety limit of 60 seconds is
used. If the time stored in the node is more than 60 seconds in the future,
we assume that the time was changed backwards and update lr->last
to the current time.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Wed, 30 May 2018 15:40:34 +0300 |
parents | d22eb224aedf |
children |
rev | line source |
---|---|
450 | 1 |
455 | 2 #user nobody; |
573 | 3 worker_processes 1; |
450 | 4 |
5 #error_log logs/error.log; | |
577 | 6 #error_log logs/error.log notice; |
7 #error_log logs/error.log info; | |
8 | |
450 | 9 #pid logs/nginx.pid; |
10 | |
11 | |
12 events { | |
573 | 13 worker_connections 1024; |
450 | 14 } |
15 | |
16 | |
17 http { | |
1394 | 18 include mime.types; |
450 | 19 default_type application/octet-stream; |
20 | |
2286
d795199b41ad
add double quotes around $request
Igor Sysoev <igor@sysoev.ru>
parents:
1907
diff
changeset
|
21 #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' |
2684
c944cba169e3
update $status in log_format example
Igor Sysoev <igor@sysoev.ru>
parents:
2286
diff
changeset
|
22 # '$status $body_bytes_sent "$http_referer" ' |
657 | 23 # '"$http_user_agent" "$http_x_forwarded_for"'; |
577 | 24 |
25 #access_log logs/access.log main; | |
26 | |
493 | 27 sendfile on; |
577 | 28 #tcp_nopush on; |
493 | 29 |
523 | 30 #keepalive_timeout 0; |
645 | 31 keepalive_timeout 65; |
450 | 32 |
33 #gzip on; | |
34 | |
35 server { | |
577 | 36 listen 80; |
37 server_name localhost; | |
450 | 38 |
573 | 39 #charset koi8-r; |
450 | 40 |
577 | 41 #access_log logs/host.access.log main; |
450 | 42 |
43 location / { | |
44 root html; | |
45 index index.html index.htm; | |
46 } | |
47 | |
657 | 48 #error_page 404 /404.html; |
49 | |
50 # redirect server error pages to the static page /50x.html | |
51 # | |
52 error_page 500 502 503 504 /50x.html; | |
53 location = /50x.html { | |
54 root html; | |
55 } | |
56 | |
569 | 57 # proxy the PHP scripts to Apache listening on 127.0.0.1:80 |
58 # | |
59 #location ~ \.php$ { | |
60 # proxy_pass http://127.0.0.1; | |
61 #} | |
62 | |
577 | 63 # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 |
64 # | |
65 #location ~ \.php$ { | |
1907
7d47e1681a62
add "root" to the fastcgi example to set correct included DOCUMENT_ROOT
Igor Sysoev <igor@sysoev.ru>
parents:
1394
diff
changeset
|
66 # root html; |
577 | 67 # fastcgi_pass 127.0.0.1:9000; |
68 # fastcgi_index index.php; | |
611 | 69 # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; |
1394 | 70 # include fastcgi_params; |
577 | 71 #} |
72 | |
645 | 73 # deny access to .htaccess files, if Apache's document root |
74 # concurs with nginx's one | |
481 | 75 # |
527 | 76 #location ~ /\.ht { |
481 | 77 # deny all; |
78 #} | |
450 | 79 } |
577 | 80 |
81 | |
82 # another virtual host using mix of IP-, name-, and port-based configuration | |
83 # | |
84 #server { | |
85 # listen 8000; | |
86 # listen somename:8080; | |
87 # server_name somename alias another.alias; | |
88 | |
89 # location / { | |
90 # root html; | |
91 # index index.html index.htm; | |
92 # } | |
93 #} | |
94 | |
95 | |
96 # HTTPS server | |
97 # | |
98 #server { | |
5319
50f531a55b73
Fixed misleading example SSL config.
Sergey Budnevitch <sb@waeme.net>
parents:
3938
diff
changeset
|
99 # listen 443 ssl; |
577 | 100 # server_name localhost; |
101 | |
102 # ssl_certificate cert.pem; | |
103 # ssl_certificate_key cert.key; | |
104 | |
5326 | 105 # ssl_session_cache shared:SSL:1m; |
577 | 106 # ssl_session_timeout 5m; |
107 | |
3938
1e90599af73b
use !aNULL to disable all anonymous cipher suites
Igor Sysoev <igor@sysoev.ru>
parents:
2684
diff
changeset
|
108 # ssl_ciphers HIGH:!aNULL:!MD5; |
5326 | 109 # ssl_prefer_server_ciphers on; |
577 | 110 |
111 # location / { | |
112 # root html; | |
113 # index index.html index.htm; | |
114 # } | |
115 #} | |
116 | |
450 | 117 } |