Welcome! Log In Create A New Profile

Advanced

keepalive ignored for some upstreams

December 05, 2016 02:40PM
Hi,

I use an nginix server with multiple servers each with a matching upstream. They are all in individual files in sites-enabled (ubuntu server).

Here is an example of such a config file:
upstream xxxxx.com {
server xxxxx.com:12908;
keepalive 65;
}

server {
listen 12908;

resolver x.y.z.a x.y.z.b;

server_name xxxxx.com;

access_log /var/log/nginx/transparent_proxy-access.log combined;
error_log /var/log/nginx/transparent_proxy-error.log;

location = /health {
return 200;
access_log off;
}

location / {
proxy_pass http://$http_host$request_uri;
proxy_pass_request_headers on;
proxy_read_timeout 65;
proxy_connect_timeout 65;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
}

for this particular "server", if I set debug in the error_log, I never see "init keepalive peer" or anything of sort indicating that keepalive is being taken into account and I *do* see that on other "servers". The other configuration files for different servers only differ by server_name, server and upstream names and by which port they use, the config files are auto-generated so I am confident that this is the only difference.
I have used tcpdump to check what nginx was doing and it's closing the connection after each response from the upstream server.

Do you see any reason why keepalive would be ignored for this configuration? The only difference with the others that work being that it uses a non standard port.

nginx version: nginx/1.10.0 (Ubuntu), I also tried the latest development ppa.

Best regards,

Fran├žois.
Subject Author Posted

keepalive ignored for some upstreams

fguerraz December 05, 2016 02:40PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 69
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready