When HAProxy is deployed on VM (such as linode.com) the performance can be decreased even more than 50%. The story behind such behavior is that the packet must be forwarded from HV to VM. Such operations are always heavy (packet is copied into memory, NIC send the interupt, which interrupts VM to HV kernel…) Worst case scenario is when one is using NAT instead of bridged interfaces.
What can you do to get better performance?
First of all understand the kernel parameters and tune them. Below you can find 2 which can have serious impact on number of processed requests:
/proc/sys/net/netfilter/nf_conntrack_tcp_timeout_time_wait (as Willy Tarreau sugests set it to 30secs)
Then go to HAProxy configuration and add
and restart your instance.
Note that both options are available from HAProxy 1.4
Here you can find more comments on the issue.