HOME

TheInfoList



OR:

ApacheBench (ab is the real program
file name A filename or file name is a name used to uniquely identify a computer file in a directory structure. Different file systems impose different restrictions on filename lengths. A filename may (depending on the file system) include: * name &nda ...
) is a single-threaded command line computer program used for benchmarking (measuring the performance of)
HTTP The Hypertext Transfer Protocol (HTTP) 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, ...
web server A web server is computer software and underlying hardware that accepts requests via HTTP (the network protocol created to distribute web content) or its secure variant HTTPS. A user agent, commonly a web browser or web crawler, initi ...
s. Originally it was used to test the Apache HTTP Server 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 Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
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 Zeus Technology, Ltd. was a software company founded in 1995 and based in Cambridge, England, known for its web server. In July 2011, Zeus Technology was acquired by Riverbed Technology. In March 2015, Riverbed Technology sold the SteelApp busin ...
), in 1996, in order to test performance of
Zeus Web Server Zeus Web Server is a discontinued proprietary high-performance web server for Unix and Unix-like platforms (including Solaris, FreeBSD, HP-UX and Linux). It was developed by Zeus Technology, a software company located in Cambridge, England tha ...
. Soon later Twiss licensed (donated) that program to the
Apache Group The Advanced Computing Environment (ACE) was defined by an industry consortium in the early 1990s to be the next generation commodity computing platform, the successor to personal computers based on Intel's x86, 32-bit instruction set architecture. ...
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. Excerpt from comments about copyright attributions found in source code of ab program.
 /*
    ** This program is based on ZeusBench V1.0 written by Adam Twiss
    ** which is Copyright (c) 1996 by Zeus Technology Ltd. http://www.zeustech.net/
                    .
                    .
                    .
    **
  */

 /*
    ** HISTORY:
    **    - Originally written by Adam Twiss , March 1996
    **      with input from Mike Belshe  and
    **      Michael Campanella 
    **    - Enhanced by Dean Gaudet , November 1997
    **    - Cleaned up by Ralf S. Engelschall , March 1998
    **    - POST and verbosity by Kurt Sussman , August 1998
    **    - HTML table output added by David N. Welton , January 1999
    **    - Added Cookie, Arbitrary header and auth support. , April 1999
    ** Version 1.3d
                    .
                    .
                    .
    ** Version 2.3
                    .
                    .
                    .
    **/


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 A Uniform Resource Locator (URL), colloquially termed as a web address, is a reference to a web resource that specifies its location on a computer network and a mechanism for retrieving it. A URL is a specific type of Uniform Resource Identifi ...
, 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, software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
thread Thread may refer to: Objects * Thread (yarn), a kind of thin yarn used for sewing ** Thread (unit of measurement), a cotton yarn measure * Screw thread, a helical ridge on a cylindrical fastener Arts and entertainment * ''Thread'' (film), 2016 ...
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 In computing, a user agent is any software, acting on behalf of a user, which "retrieves, renders and facilitates end-user interaction with Web content". A user agent is therefore a special kind of software agent. Some prominent examples of u ...
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' tool

Apache HTTPD official website
Apache Software Foundation Load testing tools