Skip to content

Commit 86c2610

Browse files
authored
IGVF-2155-modify-nginx-keepalive (#1209)
1 parent 0df0bbe commit 86c2610

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

config/gunicorn/development.conf.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
workers = 9
33
threads = 1
44
timeout = 90
5+
keepalive = 90
56
accesslog = '-'
67
logger_class = 'igvfd.logging.gunicornlogger.MyGunicornLogger'
78
access_log_format = '{\"host\":"%(h)s", \"user\":"%(u)s", \"time\":"%(t)s", \"statusline\":"%(r)s", \"status\":%(s)s, \"response_length\":%(b)s, \"referer\":"%(f)s", \"user_agent\":"%(a)s", \"db_count\":%(db_count)d, \"db_time\":%(db_time)d, \"es_count\":%(es_count)d, \"es_time\":%(es_time)d, \"rss_begin\": %(rss_begin)d, \"rss_end\": %(rss_end)d, \"rss_change\": %(rss_change)d, \"wsgi_begin\":%(wsgi_begin)d, \"wsgi_end\":%(wsgi_end)d, \"wsgi_time\":%(wsgi_time)d}'

config/gunicorn/production.conf.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
workers = 9
33
threads = 1
44
timeout = 90
5+
keepalive = 90
56
accesslog = '-'
67
logger_class = 'igvfd.logging.gunicornlogger.MyGunicornLogger'
78
access_log_format = '{\"host\":"%(h)s", \"user\":"%(u)s", \"time\":"%(t)s", \"statusline\":"%(r)s", \"status\":%(s)s, \"response_length\":%(b)s, \"referer\":"%(f)s", \"user_agent\":"%(a)s", \"db_count\":%(db_count)d, \"db_time\":%(db_time)d, \"es_count\":%(es_count)d, \"es_time\":%(es_time)d, \"rss_begin\": %(rss_begin)d, \"rss_end\": %(rss_end)d, \"rss_change\": %(rss_change)d, \"wsgi_begin\":%(wsgi_begin)d, \"wsgi_end\":%(wsgi_end)d, \"wsgi_time\":%(wsgi_time)d}'

config/nginx/docker.conf

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1+
worker_processes 4;
2+
3+
error_log stderr info;
4+
5+
worker_rlimit_nofile 4096;
6+
17
events {
2-
worker_connections 1024;
8+
worker_connections 2048;
39
}
410

5-
error_log stderr info;
611

712
http {
813

@@ -28,7 +33,8 @@ http {
2833

2934
upstream app {
3035
server pyramid:6543;
31-
keepalive 10;
36+
keepalive 32;
37+
keepalive_timeout 95s;
3238
}
3339

3440
map $http_x_forwarded_proto $forwarded_proto {
@@ -47,6 +53,7 @@ http {
4753
proxy_pass http://app;
4854
proxy_set_header Connection "";
4955
proxy_read_timeout 95s;
56+
proxy_http_version 1.1;
5057
}
5158

5259
}

config/nginx/production.conf

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
worker_processes auto;
1+
worker_processes 4;
22

33
error_log stderr info;
44

5+
worker_rlimit_nofile 4096;
6+
57
events {
6-
worker_connections 1024;
8+
worker_connections 2048;
79
}
810

911
http {
@@ -36,7 +38,8 @@ http {
3638

3739
upstream app {
3840
server 127.0.0.1:6543;
39-
keepalive 10;
41+
keepalive 32;
42+
keepalive_timeout 95s;
4043
}
4144

4245
map $http_x_forwarded_proto $forwarded_proto {
@@ -60,6 +63,7 @@ http {
6063
proxy_pass http://app;
6164
proxy_set_header Connection "";
6265
proxy_read_timeout 95s;
66+
proxy_http_version 1.1;
6367
}
6468

6569
}

0 commit comments

Comments
 (0)