Skip to main content

ApacheBench

ApacheBench (ab) is an HTTP load-generation tool distributed with the Apache HTTP Server. It sends concurrent requests to a web server and reports request throughput, latency, failures, and data transfer rates. The Virtual Client workload installs and starts an Apache HTTP Server on the system, runs ApacheBench against the local server, and converts the text output into structured metrics.

What is Being Measured?​

ApacheBench sends a configurable number of HTTP requests to http://localhost:80/ using a configurable concurrency level. The workload enables HTTP keep-alive and captures the following measurements:

  • Total benchmark execution time.
  • Complete and failed request counts.
  • Requests completed per second.
  • Mean request latency across all concurrent requests.
  • Total data transferred and the average data transfer rate.

ApacheBench reports 2 Time per request values. The Virtual Client captures the value measured across all concurrent requests because it represents the average effective request latency at the configured concurrency level.

Workload Metrics​

The following metrics are examples of those captured by the Virtual Client when running the ApacheBench workload.

NameExample ValueUnitDescription
Concurrency Level100numberNumber of requests issued concurrently
Total requests100numberTotal number of completed requests
Total time0.578secondsTotal time required to complete the benchmark
Total failed requests0numberTotal number of requests that failed
Requests172.97number/secNumber of requests completed per second
Total time per request5.781millisecondsMean request latency across all concurrent requests
Total data transferred65006bytesTotal response data transferred
Data transfer rate109.81kilobytes/secAverage response data transfer rate

Troubleshooting​

The Benchmark Cannot Connect to Localhost​

Confirm that the Apache HTTP Server is running and listening on port 80. On Linux, check systemctl status apache2. On Windows, check the Apache service and review the Apache24/logs directory in the extracted package.

Windows Reports a Missing DLL​

The Windows package includes vc_redist.x64.exe, which the executor installs before Apache HTTP Server. A failure with 0xC0000135 generally indicates that the Visual C++ runtime was not installed successfully.

Linux Setup Fails While Configuring the Firewall​

The executor runs ufw allow 80/tcp with elevated permissions. Ensure ufw is available and that the Virtual Client process can run elevated commands.

Results Parsing Fails​

Retain the ApacheBench standard output in the Virtual Client logs. The parser requires the standard summary fields beginning with Concurrency Level and reports a workload-results parsing error when those fields are absent or incomplete.