Mercurial > hg > nginx-quic
annotate auto/cc/bcc @ 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 | b7b7f3a0cc28 |
children |
rev | line source |
---|---|
455 | 1 |
2 # Copyright (C) Igor Sysoev | |
4412 | 3 # Copyright (C) Nginx, Inc. |
455 | 4 |
5 | |
6 # Borland C++ 5.5 | |
7 | |
8 # optimizations | |
9 | |
10 # maximize speed | |
11 CFLAGS="$CFLAGS -O2" | |
12 | |
13 case $CPU in | |
14 pentium) | |
15 # optimize for Pentium and Athlon | |
16 CPU_OPT="-5" | |
17 ;; | |
18 | |
19 pentiumpro) | |
20 # optimize for Pentium Pro, Pentium II and Pentium III | |
21 CPU_OPT="-6" | |
22 ;; | |
23 esac | |
24 | |
503 | 25 # __stdcall |
26 #CPU_OPT="$CPU_OPT -ps" | |
27 # __fastcall | |
2712
41f993457021
OpenSSL building by MSVC and BCC from sources
Igor Sysoev <igor@sysoev.ru>
parents:
795
diff
changeset
|
28 #CPU_OPT="$CPU_OPT -pr" |
503 | 29 |
455 | 30 CFLAGS="$CFLAGS $CPU_OPT" |
31 | |
32 # multithreaded | |
33 CFLAGS="$CFLAGS -tWM" | |
34 | |
35 # stop on warning | |
36 CFLAGS="$CFLAGS -w!" | |
37 | |
38 # disable logo | |
39 CFLAGS="$CFLAGS -q" | |
40 | |
461 | 41 |
455 | 42 # precompiled headers |
795 | 43 CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.csm" |
44 NGX_PCH="$NGX_OBJS/ngx_config.csm" | |
45 NGX_BUILD_PCH="-H=$NGX_OBJS/ngx_config.csm" | |
46 NGX_USE_PCH="-Hu -H=$NGX_OBJS/ngx_config.csm" | |
455 | 47 |
461 | 48 |
49 # Win32 GUI mode application | |
2725 | 50 #LINK="\$(CC) -laa" |
461 | 51 |
52 | |
53 # the resource file | |
469 | 54 NGX_RES="$NGX_OBJS/nginx.res" |
55 NGX_RCC="brcc32 -fo$NGX_OBJS/nginx.res \$(CORE_INCS) $NGX_WIN32_RC" | |
461 | 56 # the pragma allows to link the resource file using bcc32 and |
57 # to avoid the direct ilink32 calling and the c0w32.obj's WinMain/main problem | |
469 | 58 NGX_PRAGMA="#pragma resource \"$NGX_OBJS/nginx.res\"" |
461 | 59 |
455 | 60 |
61 ngx_include_opt="-I" | |
62 ngx_objout="-o" | |
63 ngx_binout="-e" | |
64 ngx_objext="obj" | |
461 | 65 |
573 | 66 ngx_long_start='@&&| |
67 ' | |
68 ngx_long_end='|' | |
69 | |
461 | 70 ngx_regex_dirsep='\\' |
71 ngx_dirsep="\\" |