DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
VGSources
Blog

How to Load Test Your Web Server with ApacheBench on Ubuntu

A practical ApacheBench guide for Ubuntu: install apache2-utils, create a controlled baseline, vary concurrency safely, test real request types, and read every important output field.
Length10 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install Ubuntu’s apache2-utils package, verify the ab command, then run an authorized test with explicit request and concurrency limits—for example, ab -n 1000 -c 20 https://example.com/. Increase concurrency gradually while watching the server, and judge the result from throughput, latency, failed requests, non-2xx responses, and transfer rate together.

This guide explains what each setting does, how to test GET, HEAD, and POST endpoints, and how to turn ApacheBench output into a repeatable capacity signal rather than a misleading headline number.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What ApacheBench is and what it measures

ApacheBench is the ab command-line client. Ubuntu distributes it in the apache2-utils package, and Apache HTTP Server documentation describes it as a tool for benchmarking an HTTP server. It sends requests to an HTTP or HTTPS URL and summarizes timing, throughput, and error information for that run.

The client is deliberately focused: it exercises the request you specify, not an entire browser session. A test can therefore answer a precise question such as “How many requests per second can this endpoint serve at 20 concurrent requests?” It cannot, by itself, represent every browser feature, user think time, cache pattern, or multi-step application journey.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

That distinction determines how to use the results. Treat an ab run as a controlled endpoint test. If you need realistic user capacity, define a workload model that includes the sequence of requests and pauses users actually make, then use a tool or test design capable of reproducing that model.

Install ApacheBench on Ubuntu and verify it

The package name and executable are separate: you install apache2-utils, then invoke the installed program as ab.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Refresh Ubuntu’s package metadata:

    sudo apt update
  2. Install the package that supplies ApacheBench:

    sudo apt install apache2-utils
  3. Confirm that the command is available and inspect its version:

    ab -V
  4. Display the command synopsis and available switches:

    ab -h

Run these commands on the machine that will generate the traffic, which may be different from the server under test. Keeping the load generator separate prevents the generator’s CPU, memory, network, or connection limits from being mistaken for server capacity.

Before you load test: authorization, scope, and a safe baseline

Send load only to infrastructure you own or are explicitly authorized to exercise. A benchmark creates real connections and requests; against an unrelated host it can be disruptive or interpreted as hostile traffic.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Write down the test scope before starting. Record the exact URL, HTTP method, protocol, headers, cookies, authentication method, request body, request count or duration, concurrency, keep-alive setting, and socket timeout. Also record the server revision, application configuration, cache state, and the machine and network used to generate traffic. Without this information, two apparently similar runs may not be comparable.

Begin with a modest, finite test. The following command is a useful GET baseline:

Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
ab -n 1000 -c 20 https://example.com/

Here, -n 1000 asks for 1,000 total requests and -c 20 permits 20 requests to be in flight at once. Replace the URL with an endpoint you control. The example numbers are a starting workload, not a universal benchmark or a promised capacity target.

While the command runs, observe server-side CPU and memory, access and error logs, connection limits, and application metrics. Stop the run if the service becomes unhealthy. After the baseline completes, increase concurrency in measured steps rather than jumping directly to an extreme value. Record every step and its outcome.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What -n and -c mean in ApacheBench

Option Meaning Why you should set it explicitly
-n number Total number of requests sent during the run. The default is one request, which is normally too small to represent sustained service.
-c number Number of multiple requests made at the same time, or requests in flight. It defines the pressure placed on the endpoint and makes runs comparable.

Concurrency is not the same as total volume. A run can send many requests with a low concurrency, or a smaller total with a high concurrency. Both dimensions affect what you learn: -n controls how long the sample lasts, while -c controls how many simultaneous operations the server must handle.

Always specify both values. Leaving the default single request in place can produce a number dominated by connection setup or transient timing instead of normal service behavior. Keep the endpoint, method, payload, and protocol identical when comparing different concurrency levels.

Run a time-bounded or persistent-connection test

Use a duration instead of a fixed request count

Use -t when the test should run for a defined duration rather than stop after a fixed number of requests:

ab -t 60 -c 20 https://example.com/

The duration is supplied by your test plan. A time-bounded run is useful when you want to observe a steady interval, but it does not remove the need to monitor the server or record the exact command.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Enable HTTP persistent connections

Add -k to request keep-alive behavior:

ab -n 1000 -c 20 -k https://example.com/

Keep-alive changes connection reuse and therefore changes the workload. Compare a keep-alive run only with another run using the same setting. If your production clients use persistent connections, include a matching test; if you are measuring connection setup behavior, omit it deliberately and label the run accordingly.

Set a socket timeout

Use -s to set the socket timeout in seconds:

ab -n 1000 -c 20 -s 10 https://example.com/

A timeout is part of the test definition. A shorter value can classify slow responses as failures sooner, while a longer value allows more time for a delayed response. State the chosen value when you report results.

Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

Send the request your application actually needs

A plain GET of the home page is only one workload. ApacheBench provides switches for common request variations; use them to make the benchmark match the endpoint under examination.

Add a request header

Supply a header with -H:

ab -n 1000 -c 20 -H 'Accept: application/json' https://example.com/api/items

Headers can select a representation, identify a client, or provide another application input. Preserve the exact spelling and value used in your comparison runs.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Send a cookie

Use -C for a cookie:

ab -n 1000 -c 20 -C 'session=example-value' https://example.com/account

A cookie can move an endpoint from an anonymous code path to a session-specific one. Use only test credentials and test session data, and do not paste production secrets into a command that may be saved in shell history.

Supply Basic Authentication

Use -A with a username and password:

ab -n 1000 -c 20 -A 'username:password' https://example.com/private

Only authenticate to systems you are authorized to test. Credentials written directly in a command can be exposed through shell history, process listings, terminal logs, or copied test records. Prefer a controlled test account and remove sensitive command output from shared logs.

POST a request body

Use -p to read a body from a file and -T to declare its content type:

ab -n 500 -c 10 -p body.json -T application/json https://example.com/api/items

The file must contain the body you intend to send. A POST benchmark can trigger writes, jobs, messages, or other side effects, so use an endpoint and data set designed for testing. Keep the body file, content type, and request count in the run record.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Issue HEAD requests

Add -i to issue HEAD requests when you need headers without downloading a response body:

ab -n 1000 -c 20 -i https://example.com/assets/app.js

HEAD and GET exercise different application and transfer paths. Do not compare their requests-per-second values as if they were the same workload.

Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

How to read ApacheBench output

ApacheBench prints a group of measurements. Read them together rather than selecting the largest requests-per-second figure.

Output field What it tells you How to use it
Concurrency Level The concurrency configured for the run. Confirm that the run used the intended -c value before comparing it with another run.
Time taken for tests Elapsed time for the benchmark. Use it to understand the interval over which the totals and averages were calculated.
Complete requests Requests completed by the run. Check that the completed count matches the workload you intended to send.
Failed requests Requests ApacheBench considered failures because of connection, read, content-length, or exception problems. Investigate failures before treating throughput as acceptable.
Non-2xx responses Responses outside the successful 200 range. Check application behavior, routing, authentication, and server logs; a fast error is not successful capacity.
Keep-Alive requests Requests handled using persistent connections. Verify that the result reflects the intended -k setting.
Total transferred Total data transferred during the run. Use it to see how much traffic the test generated and whether response size is a factor.
HTML transferred Transferred response content counted as HTML data. Compare runs with the same response and payload characteristics.
Requests per second Total requests divided by elapsed test time. Use as a throughput measure only alongside errors, latency, protocol, and concurrency.
Time per request ApacheBench’s reported average request timing. Compare it only across otherwise identical runs.
Transfer rate Rate at which response data was received. Consider it when response size, bandwidth, or network capacity may limit the run.

A higher requests-per-second value is not an improvement if failed requests or non-2xx responses rise. For each run, preserve the complete output and pair it with server-side logs and metrics. A valid comparison keeps the URL, protocol, method, payload, authentication, headers, cookies, keep-alive setting, timeout, and concurrency controlled.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Build a repeatable concurrency ramp

A single concurrency value tells you what happened at one pressure level. A ramp shows where behavior changes. Start with a modest value, run the same endpoint and request definition, then increase concurrency in steps. At every step, capture the command, elapsed time, complete requests, failed requests, non-2xx responses, requests per second, time per request, and transfer rate.

Keep the total request count or duration sufficient for a meaningful sample, but do not let an early successful run justify an unlimited increase. Watch for a point where latency grows, failures appear, non-2xx responses increase, or the application and connection limits become saturated. That transition is more useful than a maximum number obtained after the service is already returning errors.

Repeat each important step with the same conditions. If the first run warms a cache or initializes application resources, label that run and decide whether your capacity question concerns a cold or warm state. Do not mix those states in one comparison.

Use acceptance criteria that include errors and latency

Define success before running the test. A practical acceptance record includes:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • The exact URL and protocol.
  • The HTTP method, body, content type, headers, cookies, and authentication state.
  • The requested total or duration and the concurrency.
  • Whether keep-alive was enabled and which socket timeout was used.
  • Zero or an explicitly reviewed number of failed requests.
  • Zero or an explicitly reviewed number of non-2xx responses.
  • A requests-per-second result interpreted with its time per request and transfer rate.
  • Server-side CPU, memory, connection, access-log, error-log, and application observations.

These criteria prevent a fast stream of error responses from being reported as healthy capacity. They also make it possible to explain why two runs with similar throughput may have very different operational value.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common failure signals and what to investigate

Failed requests are nonzero

ApacheBench counts connection, read, content-length, and exception problems as failed requests. Separate those categories in your investigation using the command output and the server’s access and error logs. Check whether the failures begin only after a concurrency increase, whether the socket timeout is too short for the endpoint, and whether the server or an intermediary is rejecting connections.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

Non-2xx responses appear

Non-2xx responses are not necessarily transport failures, but they are outside the successful 200 range. Inspect the response behavior and application logs for routing, authentication, validation, rate limiting, or other endpoint conditions. Decide whether the response is expected for the test; do not silently count it as successful service.

Throughput rises while timing worsens

Requests per second is an aggregate throughput value. As concurrency increases, throughput may rise while average time per request also rises. Compare both fields and look at server resource usage. A run that processes more requests but produces unacceptable latency is not automatically a better operating point.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Transfer rate changes unexpectedly

Transfer rate depends on the amount of response data and how quickly it is received. Confirm that the endpoint, response representation, compression behavior, protocol, and request headers are unchanged before attributing a transfer-rate difference to server processing.

Compare HTTP, HTTPS, and connection behavior deliberately

ApacheBench accepts HTTP and HTTPS URLs. Protocol choice is part of the workload: use the same protocol when comparing application changes, and test each protocol separately when the deployment serves both. Do not combine an HTTP run and an HTTPS run into one throughput claim.

Likewise, persistent and non-persistent connections answer different questions. A command with -k measures behavior with keep-alive requested; a command without it measures a different connection pattern. Record this switch alongside concurrency and request count so the result remains interpretable.

What ApacheBench cannot tell you

ab does not reproduce every browser behavior, user think time, cache pattern, or multi-step application journey. It is therefore unsuitable as the sole basis for a claim about the capacity of an entire site or a complete user experience. A homepage GET, an authenticated POST, and a sequence involving several pages are different workloads even when they target the same server.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use ApacheBench when the question is narrow and controlled: for example, comparing one endpoint before and after a configuration change under the same request conditions. When the question is realistic user capacity, define the user journey, request mix, pauses, cache state, authentication, and acceptance criteria, then choose a workload model or another load-testing approach that can represent those conditions.

A compact runbook

  1. Confirm ownership or written authorization for the target.
  2. Install and verify apache2-utils, ab -V, and ab -h.
  3. Choose one endpoint and document its method, protocol, payload, headers, cookies, and authentication.
  4. Start with explicit -n and -c values, such as ab -n 1000 -c 20 https://example.com/.
  5. Set -k, -s, -t, or request-specific switches only when they match the question you are testing.
  6. Monitor CPU, memory, logs, connection limits, and application metrics while the run executes.
  7. Increase concurrency gradually, recording the full command and output for every step.
  8. Evaluate complete and failed requests, non-2xx responses, requests per second, time per request, and transfer rate together.
  9. Repeat identical runs before drawing a conclusion, and report the workload conditions with the result.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.