Oskar Stolc's Howto Collection

Articles in the HAProxy category

HAProxy - Rate Limiting

Say you just finished implementing a spam detection mechanism into your popular web service and started responding with HTTP 403s to spam queries.

This helped to eliminate the load on your database servers, but the sheer amount of abuse queries keeps your web servers busy.

You decided to employ HAProxy …

HAProxy - balance uri whole

HAProxy supports URL hash based load balancing. This is usefull if you want to create a Squid caching cluster and ensure each object is cached only once, thus increasing the cache hit ratio and the number of objects stored in the cluster. To enable the URL hash based load balancing …

HAProxy - Performance Tuning

  • use 2 distinct NICs
  • ensure connection tracking is off !!!
  • add to haproxy.cfg
option http-server-close
  • add to /etc/sysctl.conf
net.ipv4.ip_local_port_range = 1024 65000
  • If still not good, try the following (or buy a HW load balancer)
net.ipv4.tcp_tw_reuse = 1
net.core.somaxconn = 10000
net.ipv4.tcp_max_syn_backlog = 10000 …

HAProxy on CentOS 6

In this blog we will learn how to do server load balancing with HAProxy.

Our example setup will use a two-node active-standby high availability HAProxy cluster configured with three VIPs. Each HAProxy node will have its own stats page for monitoring.

IP Assignments

  • haproxy01.example.com: 192.168.40.191 …