We have setup several small clusters and are noticing strange HTTP keepalive behavior. My understanding is that keepalive in NGinx should keep the given number of connections open to the backend ES cluster. Unfortunately, we see lots of other values for open connections, but never the one we set.
In this scenario, we have nginx on the same server as ES, but the problem exists across all of our clusters, regardless.
http://IP:80/_nodes/stats/http
http: {
current_open: 1,
total_opened: 612
}
In our nginx config, we have the following:
events {
worker_connections 1024;
}
http {
upstream elasticsearch {
server 127.0.0.1:9200;
keepalive 15;
}
server {
listen 80;
location / {
proxy_pass http://elasticsearch;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_http_version 1.1;
proxy_set_header Connection "Keep-Alive";
proxy_set_header Proxy-Connection "Keep-Alive";
proxy_set_header Access-Control-Allow-Origin *;
proxy_pass_header Access-Control-Allow-Origin;
proxy_pass_header Access-Control-Allow-Methods;
proxy_hide_header Access-Control-Allow-Headers;
add_header Access-Control-Allow-Credentials true;
add_header Access-Control-Allow-Headers 'X-Requested-With, Content-Type';
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
}
}
}
Any help would be appreciated. http.enabled and network.tcp.keepalive are both set to true in the elasticsearch config, also.