Nginx LoadBalancing to Logstash

Hi there guys, I hope you're all safe.

I have two Logstash instances behind an Nginx as the load balancer. The problem is that load balancing isn't happening properly. Always, one server is receiving more traffic than the other.

I tried least_conn e round-robin on Nginx and both present the same results.

Here's my Nginx config:

           stream {
                upstream logstash {
                server server1:5044;
                server server2:5044;
                }

                server {
                listen endpoint_logstash:80;
                proxy_pass logstash;
                }
        }

As mentioned, I tried the default load-balancing method round-robin as well as least_conn. Do you guys have any idea about what could I be missing? I think it could be related to the way Logstash persists TCP connections, but it's only a hunch.

Thanks

A load balancer is typically balancing connections, not requests. If you have long-lived connections to logstash then unbalanced traffic would be normal.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.