perf(infra): enable upstream keepalive, +80% throughput, 0% errors

This commit is contained in:
Голиков Maximillian Антон
2026-10-09 12:35:14 +03:00
parent 9174641771
commit e769e08f38
9 changed files with 1507 additions and 9 deletions
+5 -1
View File
@@ -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;