2

I have a CentOS 7.1 (x64) droplet configured to load balance between 2 apache/php servers.

I have it working perfectly, but randomly throughout the day it reports the following:

haproxy[12947]: backend app_backend has no server available!

HA Proxy Log File:

Nov  5 [12947]: Server app_backend/web-live is DOWN, reason: Layer4 timeout, check duration: 2001ms. 0 active and 1 backup servers left. Running on backup. 11 sessions active, 0 requeued, 0 remaining in queue.
Nov  5[12947]: Backup Server app_backend/web-backup is DOWN, reason: Layer4 timeout, check duration: 2001ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
Nov  5[12947]: backend app_backend has no server available!

When visiting the front end it shows a 503 error, then within a few seconds it all comes back up again.

My HA Proxy Config:

global

    log         127.0.0.1 local2

    chroot           /var/lib/haproxy
    pidfile           /var/run/haproxy.pid
    maxconn      4000
    user              haproxy
    group           haproxy
    daemon
    stats socket /var/lib/haproxy/stats


defaults
    mode                    http
    log                     global
    option                  httplog
    option                  dontlognull
    option http-server-close
    option forwardfor       except 127.0.0.0/8
    option                  redispatch
    retries                 3
    timeout http-request    10s
    timeout queue           1m
    timeout connect         10s
    timeout client          1m
    timeout server          1m
    timeout http-keep-alive 10s
    timeout check           10s
    maxconn                 3000

frontend tm_application
    bind *:80
    mode http
    option forwardfor
    default_backend app_backend

backend app_backend
    mode http
    balance roundrobin
    option forwardfor
    option httpchk
        server web-live xx.xx.xx.xx:80 check
        server web-backup xx.xx.xx.xx:80 check backup

Can anyone point me at what could be wrong? to me it seems that it is trying to check 2000ms and due to server response it might be failing?

UPDATE I have tried adding a check interval of 4 seconds but this eventually does the same erroring :-/

Help :-(

4
  • Do you have any idea of what is happening on the back end servers when the checks fail? There might be nothing wrong with your config but as you say the back end servers may just not be responding quickly enough at those times and hence the checks are failing.
    – Sim
    Nov 9 '15 at 21:56
  • The servers are both WHM servers which have mirrored accounts. When accessing them directly they work fine. The only thing I can think is that theres a latency issue at the DC randomly..
    – rosey85uk
    Nov 10 '15 at 11:11
  • Did you try increasing every timeout to see if the error is related to just slow responses?
    – DavidG
    Nov 10 '15 at 20:39
  • I've raised it to 6 second interval checks and it's been fine for 4 days. Slightly concerned that I have to increase the checks that high though...
    – rosey85uk
    Nov 10 '15 at 20:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.