File tree Expand file tree Collapse file tree 1 file changed +29
-20
lines changed
frameworks/Python/aiohttp Expand file tree Collapse file tree 1 file changed +29
-20
lines changed Original file line number Diff line number Diff line change @@ -18,35 +18,44 @@ for i in $(seq 0 $((CORES-1))); do
1818 done
1919done
2020
21- # Generate Nginx configuration
22- cat > /etc/nginx/conf.d/default.conf << EOF
23- keepalive_requests 10000000;
21+ cat > /aiohttp/nginx.conf << EOF
22+ worker_processes auto;
2423
25- upstream aiohttp {
26- least_conn;
24+ events {
25+ worker_connections 65535;
26+ }
27+
28+ http {
29+ keepalive_requests 10000000;
30+
31+ upstream aiohttp {
32+ least_conn;
2733EOF
34+
2835for i in $( seq 0 $(( CORES- 1 )) ) ; do
29- echo " server 127.0.0.1:$(( 8000 + i)) ;" >> /etc /nginx/conf.d/default .conf
36+ echo " server 127.0.0.1:$(( 8000 + i)) ;" >> /aiohttp /nginx.conf
3037done
31- cat >> /etc/nginx/conf.d/default.conf << EOF
32- keepalive 32;
33- }
3438
35- server {
36- listen 8080;
39+ cat >> /aiohttp/nginx.conf << EOF
40+ keepalive 32;
41+ }
42+
43+ server {
44+ listen 8080 reuseport;
3745
38- access_log off;
39- error_log stderr error;
46+ access_log off;
47+ error_log stderr error;
4048
41- location / {
42- proxy_pass http://aiohttp;
43- proxy_http_version 1.1;
44- proxy_set_header Connection "";
45- proxy_redirect off;
46- proxy_buffering off;
49+ location / {
50+ proxy_pass http://aiohttp;
51+ proxy_http_version 1.1;
52+ proxy_set_header Connection "";
53+ proxy_redirect off;
54+ proxy_buffering off;
55+ }
4756 }
4857}
4958EOF
5059
5160echo " Starting Nginx..."
52- nginx -g " daemon off;"
61+ nginx -c /aiohttp/nginx.conf - g " daemon off;"
You can’t perform that action at this time.
0 commit comments