I'm working in a Caucho Resin backend with an HAproxy configured in front of them, in a dedicated server.

Now I'm dealing with a file upload problem. Our web application allows a file upload for images, if I hit directly to one of my Resin servers upload is very fast (5 secs) without any problem. Then, when I hit through my production load balancer image upload is super-duper slow (50/60 secs).

I've tuned the load balancer's sysctl.conf to achieve more memory to TCP sockets

net.core.rmem_max = 134217728 
net.core.wmem_max = 134217728 
net.ipv4.tcp_rmem = 4096 87380 67108864
net.ipv4.tcp_wmem = 4096 65536 67108864
net.core.netdev_max_backlog = 250000
fs.file-max = 100000

But no improvement was seen, so I took another server and installed HAproxy with my running configuration and the same tuning in the sysctl file, then I've done the same upload test and upload speed was pretty good, around 6 seconds to complete the request. So, there is no problem with my haproxy configuration file and there is no problem at the backend servers.

Since this second server is a spare server without no traffic, I understand my sysctl tuning isn't good enough on my production load balancer. Everything else works fine (normal webpage browsing, etc.)

Load balancer is a Dell R415 with Intel 82576 GbE NIC, running Haproxy 1.5.9.

Can I have some help tuning my sysctl.conf?


  • 1
    Why do you think sysctls are the problem? – Michael Hampton Jan 14 '15 at 2:34
  • Thanks for your fast reply Michael. When I was doing tests on my spare load balancer, I realized that the upload speed was terrible (without tuning sysctl). Then, after a bit of sysctl tuning, upload speed was very nice, almost as fast as hitting to the webserver. – Masterl1nk Jan 14 '15 at 2:40

50 seconds for a response is very unusual. I suggest that you remove all of the TCP sysctrl tunings, and restore all of the settings to default for your OS. Once you have the basic configuration working, then tune one parameter at a time, and benchmark.

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.