ApacheBench (
ab
is the real
program file name) is a
single-threaded command line computer program used for
benchmarking
Benchmarking is the practice of comparing business processes and performance metrics to industry bests and best practices from other companies. Dimensions typically measured are Project management triangle, quality, time and cost.
Benchmarking is ...
(measuring the performance of)
HTTP
HTTP (Hypertext Transfer Protocol) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web, wher ...
web servers. Originally it was used to test the
Apache HTTP Server
The Apache HTTP Server ( ) is a free and open-source software, free and open-source cross-platform web server, released under the terms of Apache License, Apache License 2.0. It is developed and maintained by a community of developers under the ...
but it is generic enough to test any web server supporting HTTP/1.0 or HTTP/1.1 protocol versions.
The
ab
tool is written in
C and it comes bundled with the standard Apache source distribution, and like the Apache web server itself, is free,
open source software and distributed under the terms of the
Apache License.
History
The original program was named
zb
"ZeusBench V1.0" and it was written by Adam Twiss (
Zeus Technology), in 1996, in order to test performance of
Zeus Web Server. Soon later Twiss licensed (donated) that program to the
Apache Group so that the derived program was renamed
ab
"ApacheBench".
Since 1997, 1998
ab
has been further developed and maintained, as a support program included in Apache HTTP server, from version 1.0 (1997,1998) to version 2.3 (2021) and later.
Example usage
ab -n 10000 -c 10 "http://localhost/index.html"
This will execute 10000
HTTP GET requests, processing up to 10 requests concurrently, to the specified
URL, in this example,
http://localhost/index.html
which requires that a web server is running on port 80 of the same computer where ab is run.
For an extended example of
ab
output see also
ab output for Squid performance tuning.
Concurrency versus threads
Note that ApacheBench will only use one
operating system
An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ...
thread regardless of the
concurrency level (specified by the parameter). In some cases, especially when benchmarking high-capacity
servers, a single instance of ApacheBench can itself be a bottleneck. When using ApacheBench on hardware with multiple processor cores, additional instances of ApacheBench may be used in parallel to more fully saturate the target URL.
Detecting ApacheBench
The ApacheBench
User Agent
On the Web, a user agent is a software agent responsible for retrieving and facilitating end-user interaction with Web content. This includes all web browsers, such as Google Chrome and Safari
A safari (; originally ) is an overland jour ...
string is where MAJOR and MINOR represent the major and minor version numbers of the program.
It is usually not correctly categorised by web server log analysers such as
Webalizer or
AWStats, so running ApacheBench with a great number of requests may skew the results of the reports generated by these programs.
See also
*
Internet Application Management
*
Web server benchmarking
References
{{Reflist
External links
Manual page for the 'ab' toolApache HTTPD official website
Apache Software Foundation
Load testing tools