perf(infra): enable upstream keepalive, +80% throughput, 0% errors
This commit is contained in:
+5
-1
@@ -1,7 +1,7 @@
|
||||
worker_processes auto;
|
||||
|
||||
events {
|
||||
worker_connections 512;
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
@@ -16,6 +16,8 @@ http {
|
||||
server api:8080 resolve max_fails=2 fail_timeout=5s;
|
||||
|
||||
keepalive 32;
|
||||
keepalive_requests 1000;
|
||||
keepalive_timeout 60s;
|
||||
}
|
||||
|
||||
server {
|
||||
@@ -24,8 +26,10 @@ http {
|
||||
|
||||
location / {
|
||||
proxy_pass http://backend;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
Reference in New Issue
Block a user