ApacheBench

Last updated

ApacheBench (ab is the real program file name) is a single-threaded command line computer program used for benchmarking (measuring the performance of) HTTP web servers. [1] 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.

Contents

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. [2]

Example usage

ab-n10000-c10"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. [3]

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 thread regardless of the concurrency level (specified by the -c 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 string is ApacheBench/MAJOR.MINOR where MAJOR and MINOR represent the major and minor version numbers of the program. [4] 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

Related Research Articles

<span class="mw-page-title-main">Apache HTTP Server</span> Open-source web server software

The Apache HTTP Server is a free and open-source cross-platform web server software, released under the terms of Apache License 2.0. It is developed and maintained by a community of developers under the auspices of the Apache Software Foundation.

In computing, Common Gateway Interface (CGI) is an interface specification that enables web servers to execute an external program to process HTTP/S user requests.

<span class="mw-page-title-main">Web server</span> Computer software that distributes web pages

A web server is computer software and underlying hardware that accepts requests via HTTP or its secure variant HTTPS. A user agent, commonly a web browser or web crawler, initiates communication by making a request for a web page or other resource using HTTP, and the server responds with the content of that resource or an error message. A web server can also accept and store resources sent from the user agent if configured to do so.

Server Side Includes (SSI) is a simple interpreted server-side scripting language used almost exclusively for the World Wide Web. It is most useful for including the contents of one or more files into a web page on a web server, using its #include directive. This could commonly be a common piece of code throughout a site, such as a page header, a page footer and a navigation menu. SSI also contains control directives for conditional features and directives for calling external programs. It is supported by Apache, LiteSpeed, nginx, IIS as well as W3C's Jigsaw. It has its roots in NCSA HTTPd.

curl is a computer software project providing a library (libcurl) and command-line tool (curl) for transferring data using various network protocols. The name stands for "Client for URL".

An .htaccess file is a directory-level configuration file supported by several web servers, used for configuration of website-access issues, such as URL redirection, URL shortening, access control, and more. The 'dot' before the file name makes it a hidden file in Unix-based environments.

A query string is a part of a uniform resource locator (URL) that assigns values to specified parameters. A query string commonly includes fields added to a base URL by a Web browser or other client application, for example as part of an HTML document, choosing the appearance of a page, or jumping to positions in multimedia content.

Zeus Web Server is a discontinued proprietary high-performance web server for Unix and Unix-like platforms. It was developed by Zeus Technology, a software company located in Cambridge, England that was founded in 1995 by University of Cambridge graduates Damian Reeves and Adam Twiss.

<span class="mw-page-title-main">Digest access authentication</span> Method of negotiating credentials between web server and browser

Digest access authentication is one of the agreed-upon methods a web server can use to negotiate credentials, such as username or password, with a user's web browser. This can be used to confirm the identity of a user before sending sensitive information, such as online banking transaction history. It applies a hash function to the username and password before sending them over the network. In contrast, basic access authentication uses the easily reversible Base64 encoding instead of hashing, making it non-secure unless used in conjunction with TLS.

<span class="mw-page-title-main">LoadRunner</span> Software testing tool

LoadRunner is a software testing tool from OpenText. It is used to test applications, measuring system behavior and performance under load.

<span class="mw-page-title-main">Zeus Technology</span>

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 business unit to Brocade Communications Systems. In June 2017, Brocade Communications Systems sold the vADC business unit to Pulse Secure. In December 2020 Pulse Secure, including the vADC business unit, was acquired by Ivanti.

<span class="mw-page-title-main">HTTP persistent connection</span> Using a single TCP connection to send and receive multiple HTTP requests/responses

HTTP persistent connection, also called HTTP keep-alive, or HTTP connection reuse, is the idea of using a single TCP connection to send and receive multiple HTTP requests/responses, as opposed to opening a new connection for every single request/response pair. The newer HTTP/2 protocol uses the same idea and takes it further to allow multiple concurrent requests/responses to be multiplexed over a single connection.

For computer log management, the Common Log Format, also known as the NCSA Common log format, is a standardized text file format used by web servers when generating server log files. Because the format is standardized, the files can be readily analyzed by a variety of web analysis programs, for example Webalizer and Analog.

A file inclusion vulnerability is a type of web vulnerability that is most commonly found to affect web applications that rely on a scripting run time. This issue is caused when an application builds a path to executable code using an attacker-controlled variable in a way that allows the attacker to control which file is executed at run time. A file include vulnerability is distinct from a generic directory traversal attack, in that directory traversal is a way of gaining unauthorized file system access, and a file inclusion vulnerability subverts how an application loads code for execution. Successful exploitation of a file inclusion vulnerability will result in remote code execution on the web server that runs the affected web application. An attacker can use remote code execution to create a web shell on the web server, which can be used for website defacement.

Web server benchmarking is the process of estimating a web server performance in order to find if the server can serve sufficiently high workload.

Web2py is an open-source web application framework written in the Python programming language. Web2py allows web developers to program dynamic web content using Python. Web2py is designed to help reduce tedious web development tasks, such as developing web forms from scratch, although a web developer may build a form from scratch if required.

<span class="mw-page-title-main">Web server directory index</span> Index page of a websites directory

When an HTTP client requests a URL that points to a directory structure instead of an actual web page within the directory structure, the web server will generally serve a default page, which is often referred to as a main or "index" page.

FastCGI is a binary protocol for interfacing interactive programs with a web server. It is a variation on the earlier Common Gateway Interface (CGI). FastCGI's main aim is to reduce the overhead related to interfacing between web server and CGI programs, allowing a server to handle more web page requests per unit of time.

<span class="mw-page-title-main">Sysbench</span> Linux command

In computing, sysbench is an open-source software tool. Specifically, it is a scriptable multi-threaded benchmarking tool designed for Linux systems. It is a C binary and uses LuaJIT scripts to execute benchmarks. It is most frequently used for database benchmarks, for example MySQL, but can also be used to create arbitrarily complex workloads that do not involve a database server. However, it is a multi-purpose benchmark that features tests for CPU, memory, I/O, and database performance testing. It is a basic command line utility that offers a direct and uncomplicated way to test your system. It now comes packaged in most major Linux distribution repositories such as Debian, Ubuntu, CentOS and Arch Linux.

<span class="mw-page-title-main">Vegeta (software)</span> HTTP load testing tool

Vegeta is an HTTP load testing tool written in Go that can be used as a command in a command-line interface or as a library. The program tests how an HTTP-based application behaves when multiple users access it at the same time by generating a background load of GET requests. Vegeta is used to generate a sustained, constant number of requests per second in order to discover how long a service can sustain a peak load before dropping in performance.

References

  1. "ab - Apache HTTP server benchmarking tool". Apache. Retrieved 9 October 2014.
  2. "Apache HTTP Server: ab source code, comments". Apache: HTTPd server project. 2021. Retrieved 2021-12-20.
  3. "Using Apache Bench for Simple Load Testing". Pete Freitag's ColdFusion, Java and Web Development Blog. Retrieved 9 October 2014.
  4. "User-agent detail: AB (Apache Bench) output". User-Agent-String-Info. Retrieved 9 October 2014.