annotate src/http/modules/perl/Makefile.PL @ 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 0d2956dfc4e6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
599
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
2 # Copyright (C) Igor Sysoev
4412
d620f497c50f Copyright updated.
Maxim Konovalov <maxim@nginx.com>
parents: 681
diff changeset
3 # Copyright (C) Nginx, Inc.
599
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
4
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
5 use 5.006001;
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
6 use ExtUtils::MakeMaker;
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
7
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
8 WriteMakefile(
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
9 NAME => 'nginx',
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
10 VERSION_FROM => 'nginx.pm', # finds $VERSION
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
11 PREREQ_PM => {}, # e.g., Module::Name => 1.1
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
12
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
13 ABSTRACT_FROM => 'nginx.pm', # retrieve abstract from module
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
14 AUTHOR => 'Igor Sysoev',
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
15
681
7e24168b0853 nginx-0.4.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 619
diff changeset
16 CCFLAGS => "$ENV{NGX_PM_CFLAGS}",
619
7a16e281c01f nginx-0.3.31-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 599
diff changeset
17 OPTIMIZE => '-O',
599
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
18
6700
0d2956dfc4e6 Perl: pass additional linker options to perl module.
Konstantin Pavlov <thresh@nginx.com>
parents: 5180
diff changeset
19 LDDLFLAGS => "$ENV{NGX_PM_LDFLAGS}",
0d2956dfc4e6 Perl: pass additional linker options to perl module.
Konstantin Pavlov <thresh@nginx.com>
parents: 5180
diff changeset
20
4945
ae3ebf5ac8cd Fixed build with embedded perl in certain setups (ticket #48).
Ruslan Ermilov <ru@nginx.com>
parents: 4473
diff changeset
21 INC => join(" ", map {
ae3ebf5ac8cd Fixed build with embedded perl in certain setups (ticket #48).
Ruslan Ermilov <ru@nginx.com>
parents: 4473
diff changeset
22 m#^/# ? "-I $_" : "-I ../../../../../$_"
ae3ebf5ac8cd Fixed build with embedded perl in certain setups (ticket #48).
Ruslan Ermilov <ru@nginx.com>
parents: 4473
diff changeset
23 } (split /\s+/, $ENV{NGX_INCS})),
599
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
24
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
25 depend => {
5168
482fda984556 Configure: fixed nginx.so rebuild (broken by r5145).
Maxim Dounin <mdounin@mdounin.ru>
parents: 4945
diff changeset
26 'nginx.c' => join(" ", map {
5180
2db6bdcaedc0 Configure: fixed perl Makefile generation (ticket #334).
Maxim Dounin <mdounin@mdounin.ru>
parents: 5168
diff changeset
27 m#^/# ? $_ : "../../../../../$_"
5168
482fda984556 Configure: fixed nginx.so rebuild (broken by r5145).
Maxim Dounin <mdounin@mdounin.ru>
parents: 4945
diff changeset
28 } (split(/\s+/, $ENV{NGX_DEPS}),
482fda984556 Configure: fixed nginx.so rebuild (broken by r5145).
Maxim Dounin <mdounin@mdounin.ru>
parents: 4945
diff changeset
29 "src/http/modules/perl/ngx_http_perl_module.h"))
599
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
30 },
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
31
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
32 PM => {
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
33 'nginx.pm' => '$(INST_LIBDIR)/nginx.pm'
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
34 }
869b6444d234 nginx-0.3.21-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
35 );