How to run a performance test on the haproxy load balancer using LoadForge, stress test your HAProxy.
Load testing HAProxy (or other load balancers) with LoadForge is relatively simply, but does require a high performance backend to serve the content through the load balancer.
We have typically found that a highly optimized Nginx server can return around 50,000-100,000 pages per second reliably, but that requires an extreme amount of optimization. We won't cover that in this guide, but will be focusing on how to stress test the HAProxy installation. For more information on high performance web server configurations please see this guide.
HAProxy installations typically come in three types, each with decreasing performance as their complexity increases. These modes are:
On optimized systems we typically see up to 100,000 requests per second on TCP, up to 80,000 on HTTP and far less on SSL (10,000+). Be aware of the major change in performance depending on how CPU intensive your configuration is on your HAProxy server(s).
To test the load balancer you want your webservers to respond as fast as possible and have as little load as possible. We advise 2-3 optimized Nginx systems that are returning a static text file. You can then create a very simple test which is designed to load the load balancer as opposed to the webserver, like so:
from locust import HttpUser, task, between class QuickstartUser(HttpUser): @task(1) def index_page(self): self.client.get("/test.txt")
On the LoadForge configuration side you can choose how many users to send. With this configuration you will typically see each "virtual user" create 1-2 requests per second. In terms of how to spec the load test you can look at this as a guide:
If you are testing plain HTTP or TCP it's much less load on the LoadForge test servers so you may need slightly less.
LoadForge is able to generate an extremely high amount of load, far more than any single device would be able to fulfill. If you have a very large scale installation though you can scale these tests well beyond the maximums above.
LoadForge allows for a virtually limitless amount of requests given that you can run any number of tests in parallel. The maximum capacity we have tested is 2,000,000 SSL TPS. Should you need a large scale load test we recommend booking time with us to discuss it.
You'll receive live results and a report with graphs from LoadForge. The primary things to look at are:
We provide managed performance testing as well should you need.