I am running a haproxy load balancer in front of two application servers that serves images. The problem is that if i use one server or two does not make a difference on performance (see added images). I am using Digital Ocean as provider of the Vps. The vps are running nginx and the

Load with two servers:

two servers

load with 1 server:

one Server Haproxy config looks loke this:

log local0 notice
maxconn 10000
user haproxy
group haproxy
chroot /var/lib/haproxy

    log global
    mode    http
    option  httplog
    option  dontlognull
        contimeout 5000
        clitimeout 50000
        srvtimeout 50000
    errorfile 400 /etc/haproxy/errors/400.http
    errorfile 403 /etc/haproxy/errors/403.http
    errorfile 408 /etc/haproxy/errors/408.http
    errorfile 500 /etc/haproxy/errors/500.http
    errorfile 502 /etc/haproxy/errors/502.http
    errorfile 503 /etc/haproxy/errors/503.http
    errorfile 504 /etc/haproxy/errors/504.http

frontend www
    option http-server-close
    default_backend web-backend

backend web-backend
    balance roundrobin   
    server web-1 check
    server web-2 check
  • Is both of your servers running, accepting connectios and haproxy sees it ok? Just enable stats module in haproxy and look to web interface. – Ondra Sniper Flidr Nov 8 '15 at 17:56
  • i enabled sats and it looks like both servers are serving images ang getting connections ok – globetroter Nov 8 '15 at 21:25
  • 2
    Review the syslogs generated by HAProxy, particularly the values logged for Tq/Tw/Tc/Tr/Tt. These should provide extremely useful, request-level detail of how your application is performing. Find the slow ones and investigate them in the application server logs. Load balancing a slow application will only allow you to serve more slow requests. – Michael - sqlbot Nov 9 '15 at 0:37

Adding more servers behind a load balancer will not help if your application are taking too much time to send the response.

This is the law of response time.

The load balancer will not improve your response time because he need to wait the response from the application server to serve the client, in that time the connection keep established and waiting.

Your max response time is around 70 seconds and there is +17000 requests timed out (this is not good). This is an application problem.

Also make sure your database can handle these number of connections.

More application servers = more database connections.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.