Welcome! Log In Create A New Profile


nginx load-balancing latency problem

Kiss Norbert
October 26, 2017 03:18AM
Hi Everyone

I would like to ask a little help to understand and refine my config.

The basic problem:
We have 2 nginx frontend on a same site (only for backup and sandbox the
We have 2 graylog backend servers on different sites.
The nginx servers and SERVER_B is on the same site.
The Nginx(s) forward the http traffic and the stream the log traffic.
Unfortunately we have 0.5-0.6sec latency between the sites, so the nginx
forward almost all traffic to one backend server.
At the log forward function only the safe arrive important, the latency not.
The HTTP traffic is low, so one server can serve it.

How can I tell for the nginx, this latency is ok, and don't mark SERVER_A
as unavailable?
I triedwith max_fails, fail_timeout, weight parameters without success.

My config part:

upstream graylog_syslog {
server SERVER_A:1514;
server SERVER_B:1514;
server {
listen 514;
proxy_pass graylog_syslog;
upstream graylog_beats {
server SERVER_A:5044;
server SERVER_B:5044;
server {
listen 5044;
proxy_pass graylog_beats;
upstream graylog_gelf {
server SERVER_A:12201;
server SERVER_B:12201;
server {
listen 12201;
proxy_pass graylog_gelf;

And the packets from the nginx to the backend servers (ok, I know one log
message can be fregmented to multiple TCP packages...):

tcpdump -nn -i any \(dst host SERVER_A or dst host SERVER_B\) and not port
9000 -r /tmp/log.debug | awk '{print $5}' | sort -n | uniq -c
485 SERVER_A.5044:
4157 SERVER_B.1514:
7424 SERVER_B.5044:


64 bytes from SERVER_A: icmp_seq=1 ttl=64 time=0.521 ms
64 bytes from SERVER_A: icmp_seq=2 ttl=64 time=0.523 ms
64 bytes from SERVER_B: icmp_seq=1 ttl=64 time=0.136 ms
64 bytes from SERVER_B: icmp_seq=2 ttl=64 time=0.222 ms

Any idea?


nginx mailing list
Subject Author Posted

nginx load-balancing latency problem

Kiss Norbert October 26, 2017 03:18AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 65
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