0

I'm experiencing high latency with haproxy load balancer when backend configuration uses private network IP addresses.

But when I replace backend server addresses with public IP address or Reverse DNS name I experience no latency.

  • What is causing the latency?
  • If one uses public IP or fqdn or Reverse DNS name, does network traffic bypasses haproxy?
  • Is it allowed to use public IP or fqdn or Reverse DNS name for backend servers in haproxy conf?

Configuration With Private Network IP Addresses

global
    log /dev/log    local0
    log 127.0.0.1 local1 notice
    chroot /var/lib/haproxy
    user haproxy
    group haproxy
    daemon
    maxconn 18000

    # Default SSL material locations
    ca-base /etc/ssl/certs
    crt-base /etc/ssl/private

defaults
    log global
    mode http
    option  httplog

    timeout client 30s
    timeout connect 4s
    timeout server 30s

frontend www
    bind *:80
    default_backend webservers

backend webservers
    mode http
    balance roundrobin
    server server1 10.0.0.20:80
    server server2 10.0.0.30:80

Configuration With Reverse DNS or Public IP Addresses

global
    log /dev/log    local0
    log 127.0.0.1 local1 notice
    chroot /var/lib/haproxy
    user haproxy
    group haproxy
    daemon
    maxconn 18000

    # Default SSL material locations
    ca-base /etc/ssl/certs
    crt-base /etc/ssl/private

defaults
    log global
    mode http
    option  httplog

    timeout client 30s
    timeout connect 4s
    timeout server 30s

frontend www
    bind *:80
    default_backend webservers

backend webservers
    mode http
    balance roundrobin
    server server1 90-80-70-40.aws.com:80
    server server2 90-80-70-50.aws.com:80
B.U
  • 129
  • 6

1 Answers1

1

It looks like it was a DNS issue on the host Windows machines. Added entries to host file and it worked as expected with private network IP settings.

B.U
  • 129
  • 6