My issue: uneven distribution of requests per connection, so poor connection reuse:
there are connections with thousands of requests and connections with one request only.
How I encountered the problem: tested by sending traffic to nginx, proxy requests to internal (sandwich) listener (same nginx) and upstream server.
Has anyone experienced the same? Any suggestions?
Thanks in advance!
My config:
http {
map $http_upgrade $connection_upgrade {
default ββ;
websocket upgrade;
}
map $DEBUG $should_log {
βfalseβ 0;
βtrueβ 1;
}
upstream internal {
server 127.0.0.1:8096 max_fails=0 fail_timeout=0;
keepalive 2000;
keepalive_time 50m;
keepalive_timeout 55m;
keepalive_requests 10000;
}
upstream upstream_server {
server perf.test.svc.cluster.local max_fails=0 fail_timeout=0;
keepalive 2000;
keepalive_time 50m;
keepalive_timeout 55m;
keepalive_requests 10000;
}
server {
listen 8086 backlog=1024;
access_log /tmp/8086.log 8086 if=true;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_http_version 1.1;
location / {
proxy_pass http://internal;
}
}
server {
listen 8096 backlog=1024;
access_log /tmp/8096.log 8096 if=true;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_http_version 1.1;
location / {
proxy_pass http://upstream_server;
}
}
}