I have a situation here an Nginx (nginx/1.14.2
) reverse proxy acts as a load balancer for a couple of HTTP servers. Now and then an HTTP response does not get through to the client, as if the connection were cut off too early. This does not occur without the load balancer sitting between the clients and HTTP servers, so I guess it must have to do with the Nginx configuration. Why could this be the case and how can if further diagnose and ultimately fix the situation?
I have increased error_log
to info
and observe that only info
(e.g. no warning
) messages occur during the situation. I have also installed the NGINX Prometheus Exporter and it shows nginx_connections_accepted
equal to nginx_connections_handled
throughout the situation, so apparently it does not notice any failed connections (e.g. due to timeouts). nginx_connections_active
goes up to 19 in my case, which should be fine since worker_processes
* worker_connections
= 2 * 768 >> 19. Among 100000 or so handled connections in total, only a few go wrong as described.
Typical entries from my Nginx configuration with respect to load balancing look as follows. I have chosen TCP load balancing (rather than specifically HTTP load balancing) on purpose.
stream {
# ...
server {
listen 1.2.3.4:443;
proxy_pass u_123;
}
upstream u_123 {
server 1.2.3.5:2345 max_fails=0;
server 1.2.3.6:2345 max_fails=0;
server 1.2.3.7:2345 max_fails=0;
server 1.2.3.8:2345 max_fails=0;
}
# ...
}
0 Answers