Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk10 min

How to Load Test Your Web Server with ApacheBench on Ubuntu

Use Ubuntu’s apache2-utils package to install ApacheBench, then ramp authorized HTTP or HTTPS tests while evaluating throughput together with failures, status codes, latency and server health.

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.

Install ApacheBench from Ubuntu’s apache2-utils package, verify the ab command, then run a controlled test such as ab -n 1000 -c 20 https://example.com/. The -n value is the total number of requests and -c is the number sent concurrently. Increase concurrency gradually while checking failures, non-2xx responses, latency, bandwidth, and server-side resource usage; a high requests-per-second figure is not useful if the test is producing errors.

What ApacheBench does

ApacheBench is the command-line ab client. Apache HTTP Server documentation describes it as “a tool for benchmarking your Apache Hypertext Transfer Protocol (HTTP) server.” It sends requests to a selected HTTP or HTTPS URL and reports timing, throughput, and error information for that endpoint.

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.

That makes it useful for a repeatable question such as “How many requests can this URL serve at a concurrency of 20?” It is not a complete simulation of a browser or a real user journey: it does not reproduce browser rendering, a user’s think time, multiple page requests, or every cache and connection pattern. Use it as a controlled endpoint benchmark, and use a workload model or a more sophisticated load-testing system when you need realistic application capacity.

Before you generate traffic

Test only systems you control

Load testing creates intentional traffic. Run it only against a server and endpoint that you own or are explicitly authorized to exercise. Confirm the permitted time window, source IP, request volume, and any provider or hosting limits before starting. A test against an unapproved site can be disruptive and may be treated as an attack.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Choose an observable endpoint

Start with one stable URL whose behavior you understand. Record whether it is HTTP or HTTPS, the HTTP method, expected response code, typical response size, authentication requirements, and whether the request changes data. A public, read-only endpoint is safer for a first run than a purchase, login, or other state-changing operation.

Watch the server while the client runs

Record CPU, memory, network throughput, connection counts, web-server access and error logs, application metrics, database usage, and any reverse-proxy limits. The client output alone cannot tell you whether the bottleneck is the web server, application code, database, network, or the machine running ab.

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

Install ApacheBench on Ubuntu

Ubuntu supplies ab in the apache2-utils package. Install it with the package manager, then check that the executable responds:

  1. Refresh package metadata:
sudo apt update
  1. Install the package:
sudo apt install apache2-utils
  1. Print the installed version:
ab -V
  1. Display the command’s options and syntax:
ab -h

If ab -V and ab -h return command information, the installation is ready. Keep the version output with your test notes because results from different client or server versions are not automatically interchangeable.

Run a safe baseline test

Use explicit request and concurrency values

A basic GET benchmark is:

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

-n 1000 asks for 1,000 total requests. -c 20 allows 20 requests to be in flight at once. Specify both options: the documented default is one request, which is normally too small to represent concurrent service behavior.

Replace the example URL with an endpoint you are authorized to test. Keep the trailing slash or path exactly as intended; changing the path, query string, protocol, or redirect behavior changes what you are measuring.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Ramp instead of jumping to a peak

Begin with a small run, check the result, and raise concurrency in steps. For example:

Stage Command Purpose
Smoke check ab -n 20 -c 1 https://example.com/ Confirm DNS, routing, TLS, the method, and the expected response.
Low concurrency ab -n 200 -c 5 https://example.com/ Establish a quiet baseline before sustained pressure.
Moderate concurrency ab -n 1000 -c 20 https://example.com/ Measure a repeatable workload with 20 in-flight requests.
Higher concurrency ab -n 2000 -c 50 https://example.com/ Increase pressure only if the previous stage is healthy.

The numbers in this progression are a test plan, not a capacity claim. Stop or reduce the load if error rates, latency, resource exhaustion, or application behavior becomes unsafe.

Use a duration instead of a fixed request count

For a time-bounded run, add -t with the duration in seconds. A duration test is useful when you want to observe behavior over a fixed interval rather than complete a predetermined number of requests. Still set the concurrency explicitly:

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

Record the duration, concurrency, and endpoint together. A 60-second run at one concurrency is a different workload from a 60-second run at 20.

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

Test connection reuse deliberately

Add -k to request persistent HTTP connections:

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

Run with and without -k only when that comparison answers a real question. Connection setup, TLS handshakes, proxy behavior, and keep-alive limits can materially change the result, so label the setting in your notes.

Set a client-side socket timeout

Use -s to set the socket timeout in seconds:

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

A timeout limits how long the client waits for a socket operation. It does not make a slow response successful; timed-out or interrupted operations can appear as failed requests.

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Send different kinds of requests

ApacheBench options let you keep the load shape while changing the request details. Each variation should be recorded because method, headers, payload size, authentication, and response size affect server work.

Add a request header

ab -n 500 -c 10 -H 'Accept: application/json' https://example.com/api/status

-H adds the specified header. Include only headers that are required to reproduce the authorized request; an Accept value can select a different representation and therefore a different response size or code path.

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

Send a cookie

ab -n 200 -c 5 -C 'session_id=example-value' https://example.com/account

-C sends a cookie. Use a test account and a non-sensitive value whenever possible. A shared session can serialize work or change caching, so do not interpret that run as anonymous traffic.

Supply Basic Authentication carefully

ab -n 100 -c 2 -A 'username:password' https://example.com/protected

-A supplies Basic Authentication credentials. The command line can be stored in shell history and may be visible to local process inspection. Use only authorized test credentials, protect the test machine, and remove or secure the history entry afterward.

POST a body

Place the request body in a file and specify its content type:

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

-p body.json reads the body from the named file, while -T application/json declares its media type. Use a test endpoint or an idempotent operation. Replaying a state-changing body can create records, send messages, charge an account, or otherwise alter data.

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.
Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Use HEAD when you need headers only

ab -n 200 -c 10 -i https://example.com/

-i uses HEAD requests, which check response headers without downloading the response body. Confirm that the application handles HEAD correctly; some applications route HEAD differently or return incomplete behavior.

Understand the ApacheBench output

After a run, ab prints a summary containing the workload and the resulting timing, transfer, and error fields. Save the complete output rather than copying only requests per second.

Field What it tells you How to use it
Concurrency Level The configured number of simultaneous requests. Compare runs only when this value and the other workload settings match, or explain the difference.
Time taken for tests Elapsed time for the run. Use it with the request count to understand the test window.
Complete requests Requests that completed during the run. Check that the count matches the intended workload and compare it with failed requests.
Failed requests Requests considered failures because of connection, read, content-length, or exception problems. Any unexpected nonzero value requires investigation before treating throughput as capacity.
Non-2xx responses Responses outside the successful 200 range. Inspect application and routing behavior; an HTTP error page can still have completed at the transport level.
Keep-Alive requests Requests handled using persistent connections when keep-alive was enabled. Verify that the result reflects the intended -k setting and server connection policy.
Total transferred All bytes received during the run, including protocol-related data reported by the client. Use it to spot bandwidth or response-size effects.
HTML transferred Response content bytes transferred by the benchmark. Compare this when endpoint representations or payload sizes differ.
Requests per second Aggregate requests divided by elapsed test time. Use it as a throughput measurement only alongside failures, response codes, and latency.
Time per request The average timing reported by ab. Compare identical URLs, methods, payloads, protocols, and concurrency values; do not compare unlike runs.
Transfer rate The received data rate. Determine whether response size or available bandwidth is influencing the run.

Interpret requests per second with errors

Requests per second is total throughput, not a quality score. A server that returns many errors quickly can show a higher rate than one that returns valid responses more slowly. Treat a run as acceptable only under criteria you define in advance, such as zero unexpected failed requests, no unexpected non-2xx responses, an agreed latency limit, and acceptable CPU, memory, database, and network behavior.

Distinguish failed requests from non-2xx responses

A failed request indicates a client-observed connection, read, content-length, or exception problem. A non-2xx response reached the client but had an HTTP status outside the successful 200 range. They can occur separately: an application may return an error page cleanly, or a connection may fail before any HTTP status is received. Examine server logs and the endpoint’s expected status to determine which case you have.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Design comparable runs

Repeatability matters more than a single impressive number. Keep these axes constant when comparing two runs, unless the axis is the variable you intentionally changed:

  • Request method: GET, HEAD, or POST.
  • Protocol and URL: HTTP versus HTTPS, host, path, and query string.
  • Concurrency and total request count, or the exact duration.
  • Keep-alive behavior.
  • Request headers, cookies, authentication, and body content.
  • Response and payload size.
  • Client machine, network location, and test time.
  • Server software configuration and application version.

Run the same command multiple times after the server reaches a comparable state. Record warm-up effects, cache state, deployment changes, background jobs, and any rate limiting. Compare the complete output and server-side observations, not only the headline throughput.

Define an acceptance rule before testing

An acceptance rule turns output into a decision. For example, you might require the intended number of complete requests, zero unexpected failed requests, no unexpected non-2xx responses, a maximum average time per request, and no exhaustion of a monitored resource. The thresholds must come from your service objective; ApacheBench does not provide a universal requests-per-second target.

Troubleshoot unexpected results

The command is missing

Install apache2-utils with sudo apt update followed by sudo apt install apache2-utils, then rerun ab -V. If a managed Ubuntu image uses restricted package repositories, resolve package availability before interpreting any benchmark result.

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

All or many requests fail

  • Run the one-request smoke test with -n 1 -c 1 and verify DNS, routing, TLS, and the URL.
  • Check web-server and application error logs at the exact test time.
  • Confirm that firewalls, reverse proxies, connection limits, and rate limits are not rejecting the client.
  • Increase the client-side timeout with -s only after confirming that the endpoint is expected to take that long; do not hide a genuine server problem by choosing an arbitrary large timeout.
  • Verify that the request method, headers, cookie, credentials, and body match the authorized test case.

Non-2xx responses increase with concurrency

Inspect the actual status and server logs. The application may be overloaded, a dependency may be timing out, a protection layer may be rate limiting the source, or the test may be sending an invalid or state-conflicting request. Reduce concurrency, restore a safe request body, and repeat only after identifying the cause.

Requests per second changes between identical runs

  • Check whether the client or server is CPU- or network-bound.
  • Look for cache warming, garbage collection, database pools, background jobs, or autoscaling changes.
  • Confirm that DNS, TLS, redirects, keep-alive, and response size are the same.
  • Ensure that another workload is not sharing the test machine or server.
  • Repeat the run and retain every command and output so an outlier is visible.

The client becomes the bottleneck

ab is itself a client. At high concurrency or with large HTTPS responses, its host, network path, ephemeral ports, or CPU can limit the observed rate before the server is saturated. Monitor the load generator and, if necessary, distribute or redesign the test rather than claiming the server reached its limit.

When ApacheBench is the right tool

Use ApacheBench when you need a compact, scriptable benchmark of one HTTP or HTTPS endpoint with a clearly defined method, concurrency, request count or duration, and request data. It is especially useful for checking a configuration change, comparing two controlled deployments, or finding the point at which a single endpoint begins returning errors.

Choose a different workload approach when the question involves several dependent requests, user think time, browser assets and JavaScript, many user identities, complex authentication flows, WebSockets, long-lived sessions, or a realistic mix of endpoints. ApacheBench’s summary is intentionally narrow; it cannot by itself establish whole-site capacity or user-perceived performance.

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

Keep a reproducible test record

For each run, save the exact command, ab -V output, date and time, client location, target URL, method, payload and headers, concurrency, request count or duration, keep-alive and timeout settings, complete client output, and server-side metrics. Note deployments, cache state, rate limits, and any interruption. This record lets you reproduce a result and prevents an isolated requests-per-second number from being mistaken for a durable capacity limit.

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 from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

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.