3 Million and Beyond – Creating Scalable Web Clusters with LVS
When I first set out on this project, I was asked to build a cluster of web servers that could handle 3 million http requests per second. After much tinkering and tuning, I was able to make it happen using Linux Virtual Server (Red Hat’s load balancer), Nginx (a fast http server), and Tsung (a heavy-duty distributed load generator).
I found that LVS scales incredibly well on a 10-gigabit network with little tuning, and it seemed to handle large amounts of http traffic with relative ease. My LVS Router’s load remained very low (under 1.00, on average), since LVS Direct Routing allowed the web servers (cluster nodes) to handle the bulk of the traffic.
I used 6 web servers, 1 LVS Router, and 7 Load Generators. The machines were SuperMicro 1U servers with dual-socket Westmere Xeon (6-core) processors, and 48G RAM. The important part here was the network. 10-gigabit ethernet allowed my cluster to distribute large amounts of http traffic among the nodes.
While the original goal was 3 million requests/sec, I was able to get up to about 5 million regularly, through repeated tests. (If you count the very highest spike in traffic, it actually peaked around 8 million). The type of data being transferred was very small (a static text file containing a single character), since this is a test of raw req/sec and not a real-world simulation.
The following 3 articles give an idea of how this was done, and provides a basic guideline for creating your own high-performance web cluster.