Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a strange problem when using HAProxy to loadbalance some webservers. The response through the load balance gets very slow sometimes...

My script:

global
  daemon
  quiet
  maxconn          4096
  nbproc           2

listen XMLRPC 0.0.0.0:8888
  mode http
  balance roundrobin
  option httpclose
  option forwardfor
  server Srv1(10.199.100.111:8082) 10.199.100.111:8082 check inter 10
  server Srv2(10.199.100.112:8084) 10.199.100.112:8084 check inter 10

listen Custom1 0.0.0.0:60080
  mode http
  balance roundrobin
  option httpclose
  option forwardfor
  server Srv1(10.199.100.111:60081) 10.199.100.111:60081 check inter 10
  server Srv2(10.199.100.112:60083) 10.199.100.112:60083 check inter 10

listen Statistics 0.0.0.0:7000
  balance
  timeout connect 60000
  timeout client  60000
  timeout server  60000
  option httpclose
  mode http
  stats enable
  stats uri /
  stats hide-version
  stats auth admin:admin

When I take out the load balancers and connect to the webservers directly, this problem does not occur, but then I don't have load balancing/failover, so that's not what I want.

Does anyone have an indication on what is going wrong here? Why would some requests go lightning fast, and others really slow (10-15seconds)?

Thanks in advance!

share|improve this question

migrated from stackoverflow.com Jan 31 '11 at 1:14

This question came from our site for professional and enthusiast programmers.

1 Answer 1

I see nothing obviously wrong. You don't have any timeout which is bad, but this is unrelated. You should enable logging, it will tell you where the request spent time. For this, please use "option httplog" and "log 127.0.0.1 local0" then setup your syslogd to receive logs on the UDP socket (eg: syslogd -r).

Hmmm yes there's something wrong in your config. You check the servers 100 times a second, which might be too much for them. Replace "inter 10" with "inter 10s".

Willy

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.