Are you using keepalive on haproxy? Perhaps you are confronting nginx with 
keepalive enabled and haproxy with client-side keepalive disabled?

Can you share the haproxy config?

Thomas is right, you should probably unload conntrack for best performance.

Also make sure you don't have any network issues (packet loss or reordering).


Regards,

Lukas


----------------------------------------
> Date: Wed, 6 Mar 2013 17:27:19 +0200
> From: a...@pagepeeker.com
> To: haproxy@formilux.org
> Subject: Lots of TIME_WAITs and slow response time
>
>
> Hi,
> I have a 3 server architecture, a HAproxy that sends balanced traffic to
> 2 Nginx servers.
>
> I noticed that if I run "ab -n 1000 -c 100" directly on the Nginx server
> I get response times between 40 and 80ms
> If I run the same test via HAproxy I receive results between 120 and
> 4000ms. And this is I get lucky as I can even wait for 30seconds to get
> all the replies back from HAproxy server.
>
> I've been struggling to tune the kernel params and other things for days
> now but I still cannot make this work properly.
> I noticed that on HAproxy server I have all the time at least 20K
> TIME_WAIT connections ( netstat -a -n|grep TIME_WAIT|wc -l)
> while on the Nginx servers that number is about 600 for each one.
>
> I suspect that is because of this that the service doesn't always
> perform well but I would surely appreciate any advice from you.
> Also, let me know what kernel params or configuration files you might
> need me to share with you in order to get a better understanding.
>
> Thank you,
> Alex
>
                                          

Reply via email to