Generating Millions of HTTP Requests per Second: Tsung, JMeter, and More
This article explains how to achieve ultra‑high HTTP request rates by using load‑generating tools such as Apache Bench, httperf, JMeter and Tsung, discusses Linux socket limits, provides step‑by‑step installation and configuration examples for Tsung on CentOS, and shows how to run tests and interpret the results for building a high‑performance web cluster.
This article documents the first part of a series on building a high‑performance web cluster capable of handling three million requests per second, focusing on load‑generating tools and their configuration.
Load‑Generating Tools
When stress‑testing a server you are limited by the number of simultaneous socket connections a Linux machine can open (about 64,000 by default). To generate enough load you must either reuse connections efficiently or use multiple load‑generator machines.
Apache Bench (ab)
ab is a simple, widely available benchmark tool that comes with Apache, but it typically produces only around 900 requests per second on the author’s system, making it unsuitable for high‑scale testing.
Httperf
Httperf is more powerful but still limited. An example command that creates 100,000 sessions at a rate of 1,000 per second, each session issuing five requests with a 2‑second interval is shown:
httperf --hog --server=192.168.122.10 --wsess=100000,5,2 --rate 1000 --timeout 5The output includes connection rates, request rates, reply statistics, CPU usage and network I/O.
Using this configuration the author reached 6,622 connections per second.
Apache JMeter
JMeter is a full‑featured web‑application testing suite that can simulate real user behavior. With plugins and “Stepping Threads” plus “HTTP RAW” requests it can generate up to 30,000 requests per second, though this is near its limit.
Tsung
Tsung is a heavy‑duty, distributed, multi‑protocol load‑testing tool that can generate around 40,000 requests per second and, with proper configuration, can reach the million‑request‑per‑second range. It produces HTML charts and detailed reports.
Installing Tsung on CentOS 6.2
First enable the EPEL repository, then install Erlang and required packages:
yum -y install erlang perl perl-RRD-Simple.noarch perl-Log-Log4perl-RRDs.noarch gnuplot perl-Template-Toolkit firefoxDownload and extract Tsung:
wget http://tsung.erlang-projects.org/dist/tsung-1.4.2.tar.gz</code><code>tar zxfv tsung-1.4.2.tar.gz</code><code>cd tsung-1.4.2</code><code>./configure && make && make installCopy the example configuration to ~/.tsung and edit it as needed.
Tsung XML Configuration Overview
<client> defines a load‑generator host, its IP, CPU weight and maximum simulated users.
<servers> lists the target HTTP servers to test.
<load> contains one or more <arrivalphase> elements that control how users arrive over time.
<session> describes the actions each simulated user performs; probability can be used to randomize behavior.
<for from="1" to="10000000" var="i"> loops a request many times to amplify request volume while using few connections.
Example snippet creating a simple HTTP GET request:
<session probability="100" name="ab" type="ts_http"></code><code> <for from="1" to="10000000" var="i"></code><code> <request><http url="/test.txt" method="GET" version="1.1"/></request></code><code> </for></code><code></session>After configuring, create a convenient alias to view the generated HTML report:
alias treport="/usr/lib/tsung/bin/tsung_stats.pl; firefox report.html"Start the test on a load node: tsung start When the test finishes, view the report located in ~/.tsung/log/<em>timestamp</em>. The report includes graphs of request rates, response times and resource usage.
With a powerful load‑testing tool in place, the next steps are to benchmark a single HTTP server, tune the web server and TCP stack, build an LVS cluster of tuned servers, and finally stress‑test the LVS cluster with Tsung.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
