Linux – HAProxy keeps dropping connections

haproxylinux

My HAProxy instance isn't even under any serious load right now, but occasionally it will start refusing to accept connections, even though the backend servers are up and running fine. I didn't see anything in the logs either. Am I missing something important from my configuraiton?

global
        log 127.0.0.1   local0
        log 127.0.0.1   local1 notice
        #log loghost    local0 info
        maxconn 4096
        chroot /var/lib/haproxy
        user haproxy
        group haproxy
        daemon
        #debug
        #quiet

defaults
        log     global
        mode    http
        option  httplog
        option  dontlognull
        retries 3
        option redispatch
        maxconn 2000
        contimeout      5000
        clitimeout      50000
        srvtimeout      50000

frontend http-in
        bind *:80
        acl host_staging hdr_end(host) -i staging.example.com
        acl host_prod hdr_end(host) -i example.com

        acl url_wiki url_beg /wiki
        acl url_go   url_beg /greenapp

        use_backend kumquat if host_staging url_wiki
        use_backend kumquat if host_staging url_go
        use_backend cumberland if host_staging

        default_backend cumberland

backend kumquat
        server kumquat kumquat.example.com:8080 maxconn 1000

backend cumberland
        server cumberland cumberland.example.com:80 maxconn 1000

Best Answer

It turns out my problem had nothing to do with HAProxy. I tried Nginx and ran into the same problem. I then tried running a different distribution: CentoOS, and even after I shut down the old machine, when CentOS booted up it said the IP address was still in use. I had another VM I had forgotten to shut down which had the same IP address. openSUSE doesn't do checking to make sure another machine with the same IP doesn't exist on the network. They were conflicting with each other.