Hi,

We noticed something strange with haproxy. we have one haproxy node in front of 
a web server implemented inefficiently, such as loading 25 js files). Both 
servers are located in EU, when testing from EU, there is not difference in 
response time connecting to the web server directly or connecting through 
haproxy.

However, when testing it from US, because of the latency, it takes 7 seconds to 
load if connecting to the web server directly but 15 seconds if connecting 
through haproxy and this behavior is very consistent. We also tested from China 
and it takes 19 seconds directly but 30 seconds through haproxy.

We have very simple haproxy.cfg, see below.

Any idea why haproxy adds 10second in the latency case?

Thanks
Wei

global
   daemon
   maxconn 10000
   stats socket /var/run/haproxy.stat mode 666 level admin

defaults
   mode http
   retries 3
   timeout connect 300000ms
   timeout client 300000ms
   timeout server 300000ms
   option httplog
   log 127.0.0.1 local0
   log 127.0.0.1 local1 notice
   option forwardfor
   option httpclose
   option http-pretend-keepalive

frontend node_frontend
   maxconn 10000
   backlog 10000
   bind *:80
   bind *:443 ssl crt /etc/haproxy/pem crt /data/certs/
   acl is_websocket hdr(Upgrade) -i WebSocket
   acl is_websocket path_beg /socket.io
   acl is_app_521e2579d654b30000000550 hdr_beg(host) -i test.test.com

   use_backend websocket_app_521e2579d654b30000000550 if is_websocket 
is_app_521e2579d654b30000000550
   use_backend node_app_521e2579d654b30000000550 if 
is_app_521e2579d654b30000000550
   default_backend default

backend default
   mode http
   server server0 127.0.0.1:7000 maxconn 20

backend node_app_521e2579d654b30000000550
   mode http
   server server_52029d2d0d120104610bc722 172.31.29.16:1011 maxconn 4

backend websocket_app_521e2579d654b30000000550
   mode http
   server server_52029d2d0d120104610bc722 172.31.29.16:1011 maxconn 1000

listen stats :8081
   mode http
   balance roundrobin
   stats uri /
   server none 127.0.0.1

Reply via email to