Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober 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
World desk10 min

How to Benchmark HTTP Latency with wrk on Ubuntu

A practical, reproducible guide to HTTP latency benchmarking with wrk on Ubuntu, covering installation, workload design, output interpretation, Lua scripts, repeatability and troubleshooting.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install Ubuntu’s wrk package, run a controlled test such as wrk -t4 -c100 -d30s --latency http://127.0.0.1:8080/, and interpret the result together with client CPU, server behavior, errors and timeouts. The command’s four threads and 100 connections are only a starting workload—not a universal performance target.

What wrk measures

wrk is a multithreaded HTTP load generator designed to create substantial traffic from one multicore CPU. It uses scalable event-notification systems such as Linux epoll (and kqueue on systems that provide it). Optional LuaJIT scripts let you generate request bodies, alter headers and paths, exercise several request types, validate responses or produce custom reports.

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.

For latency work, wrk measures the time between sending a request and receiving its response from the load generator’s point of view. That figure includes network transit, server queueing, application processing, response transmission and any client-side scheduling delay. It does not, by itself, tell you which component caused a slow response. A saturated wrk host can make a healthy server look slow, while a server that returns errors quickly can produce an attractive average.

Use it only against an endpoint you own or are explicitly authorized to test. Begin with a local or staging service, then move to production-like infrastructure under an agreed load budget.

#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.

Install wrk on Ubuntu

Install the Ubuntu package

Ubuntu’s Noble package documentation lists the package as wrk, version 4.1.0-4build2. The package version on another Ubuntu release can differ, so treat that version as the Noble documentation value rather than a promise for every release.

  1. Refresh package metadata: sudo apt update.
  2. Install wrk: sudo apt install wrk.
  3. Verify that the executable is available: wrk --version.

The command form is wrk <options> <url>. If wrk --version fails, check that the package installation completed and that the directory containing the executable is on your PATH.

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

Build the upstream source

Building is useful when the distribution package is unavailable or when you need a source version that is different from Ubuntu’s package. Obtain the wg/wrk source, change into its directory and run make. The upstream installation notes describe builds on most UNIX-like systems with GNU make, LuaJIT and OpenSSL. The build can use bundled dependencies or system installations selected with WITH_LUAJIT and WITH_OPENSSL.

Keep a record of whether each comparison used the Ubuntu package or a source build. Changing the executable, LuaJIT, OpenSSL or compiler between runs can change client-side behavior and make results harder to compare.

Prepare a reproducible baseline

Before changing application code or server settings, fix the variables that affect a latency result:

  • Use a URL and HTTP method that represent the operation you want to measure.
  • Keep request headers, body, authentication state and path identical between compared runs.
  • Record the wrk version, Ubuntu release, client host and server host.
  • Record whether the client and server are on the same machine, the same network or a routed path.
  • Use the same thread count, connection count, duration and timeout for each condition unless that variable is the subject of the experiment.
  • Separate warm-up traffic from measured traffic when caches, JIT compilation, connection pools or TLS session setup need time to settle.
  • Repeat each condition and retain the detailed output, including errors and timeouts, rather than keeping only one average.

A simple local baseline is:

sudo apt update
sudo apt install wrk
wrk --version
wrk -t4 -c100 -d30s --latency http://127.0.0.1:8080/

This starts four wrk worker threads, maintains 100 total HTTP connections, runs for 30 seconds and requests detailed latency statistics. It is a starting workload, not an expected Ubuntu result. Increase concurrency in controlled steps only after confirming that the client and server can handle the previous step.

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.

Understand every workload option

Option Meaning How to use it
-t Number of wrk worker threads -t4 creates four workers. More threads can use more client CPU; they do not automatically improve server performance.
-c Total open HTTP connections -c100 keeps 100 connections open across all workers. Each thread handles a share of them.
-d Test duration Use units such as 30s, 2m or 2h. A short run is more sensitive to connection setup and warm-up.
--latency Detailed latency report Add it when averages, spread and maximum latency are needed.
-H Additional request header For example, -H 'User-Agent: wrk'. Quote the complete header when the value contains spaces.
--timeout Response-wait limit Use it to classify a response as timed out when it is not received within the specified interval. Choose a value that reflects the operation and document it.
-s LuaJIT workload script -s script.lua enables POST bodies, dynamic headers, multiple paths, authentication flows, response checks or custom reporting.

Ubuntu documents SI suffixes for numeric arguments, including 1k, 1M and 1G. Check the resulting command carefully: -c1k means 1,000 connections, which can be a much larger test than an unqualified value.

Choose threads, connections and duration deliberately

Threads

Threads are client-side workers, not server worker processes. Start with a modest number and watch the load generator’s CPU. If one client host is CPU-bound, its request-generation ceiling can dominate the measured latency. Add threads only when the client has spare CPU and the server is the component you intend to stress.

Connections

Connections are the total number of open HTTP connections, distributed among wrk threads. A low connection count may describe a single-user or low-concurrency service; a high count tests queueing and simultaneous demand. Compare alternatives on the connection axis instead of presenting one value as “the” benchmark setting.

Duration

A 30-second run is convenient for an initial comparison, but it can hide slow degradation, garbage-collection cycles or cache changes. Use a longer duration when the question concerns sustained behavior. Keep a separate warm-up interval if the application performs one-time initialization.

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

Request shape

Concurrency alone is not enough. When alternatives exist, compare both connection/thread levels and request shape: method, path, headers, body and authentication. A cached GET and an authenticated database-backed POST are different workloads even when they use the same number of connections.

Run a controlled latency test

  1. Confirm authorization and health. Verify that the URL is a controlled endpoint and that the service is healthy before introducing load.
  2. Record the test definition. Write down the exact URL, method, headers, body, credentials or token state, client and server addresses, wrk version, thread count, connection count, duration and timeout.
  3. Warm the service separately. Send non-measured traffic if caches, JIT compilation, pools or TLS setup would otherwise contaminate the first measured interval.
  4. Run the baseline. For a simple GET, use wrk -t4 -c100 -d30s --latency http://127.0.0.1:8080/.
  5. Watch both machines. Observe client CPU, server CPU, memory, network, connection counts and application errors while the test runs.
  6. Repeat the condition. Keep the same settings for multiple runs and preserve each report. Do not replace a distribution with a single best-looking run.
  7. Change one planned variable. Increase connections, alter threads, change the request shape or extend duration, then repeat the same observation process.

Do not benchmark an uncontrolled public endpoint. A high-rate test can exhaust another operator’s capacity and can also produce misleading data if a proxy, rate limiter or intermediate network device intervenes.

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

Read wrk’s output correctly

A normal report includes the number of threads and connections, per-thread latency average, standard deviation, maximum and the proportion within one standard deviation, per-thread requests per second, total requests and bytes read, aggregate requests per second and transfer per second. The --latency flag adds the detailed latency statistics needed to see spread rather than only a headline average.

  • Average latency is the arithmetic mean for the recorded requests. A small mean can coexist with a long tail.
  • Standard deviation describes how widely observations vary around the mean. It is not a percentile and does not replace tail measurements.
  • Maximum latency is the slowest recorded request in that run. It is useful for spotting outliers, but it is unstable across short runs.
  • Requests per second is achieved throughput for the run, not a guaranteed capacity limit.
  • Transfer per second depends on response size as well as request rate; it should not be compared across endpoints with different payloads without accounting for bytes.
  • Timeouts and errors must be recorded separately from successful latency. A fast error is not a fast successful response.

wrk’s standard report is not a universal service-level objective. If you need a specific percentile or a custom classification, use a Lua script or another reporting method that explicitly calculates it, and document the method.

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.

Do not copy the upstream sample as an expectation

The upstream README shows an illustrative 30-second run with 12 threads and 400 connections. Its sample reports average latency of 635.91us, standard deviation of 0.89ms, maximum latency of 12.92ms, 93.69% within one standard deviation, 748,868.53 requests per second and 606.33 MB per second of transfer. Those values belong to that particular workload, endpoint, hardware and network path. They are not Ubuntu benchmarks or targets for your service.

No universal expected latency, throughput target or percentile SLA is established for Ubuntu and wrk. Set targets from your own endpoint’s contract and measurements under the traffic conditions you need to support.

Benchmark POST and authenticated endpoints with Lua

Use -s when a command-line GET cannot express the operation. A static POST body can be defined in a script:

wrk.method = "POST"
wrk.body   = '{"name":"example"}'
wrk.headers["Content-Type"] = "application/json"
wrk.headers["Authorization"] = "Bearer REPLACE_WITH_TEST_TOKEN"

Save the file as post.lua and run it against the intended path:

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.
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.
wrk -t4 -c100 -d30s --latency -s post.lua http://127.0.0.1:8080/api/items

Use a test-only token or account with the minimum permissions required. Never put a production secret in a script that will be shared or committed. If tokens expire, generate or rotate them outside the measured interval and keep the authentication state consistent between runs.

Scripts can also choose among multiple paths, create dynamic headers, generate request data, inspect responses and implement custom reporting. The upstream guidance warns that work performed for every request—especially constructing a new request and using a response handler—reduces the load wrk can generate. A script that only changes the method, path, headers or body does not have a performance impact according to that guidance. Keep per-request Lua logic minimal when measuring the server rather than the client script.

Validate the endpoint independently before a high-rate run. A malformed JSON body, missing header or expired token can turn the benchmark into an error-rate test without making that obvious from a throughput number alone.

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

Build a useful comparison matrix

Instead of one arbitrary command, define a small matrix that answers a specific capacity question. For example:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Run Threads Connections Duration Request shape Purpose
Baseline 4 100 30s Known-good GET Establish repeatable behavior and check the harness.
Concurrency step 4 200 30s Same GET Observe queueing and tail growth as demand rises.
Client scaling 8 200 30s Same GET Check whether the original client thread count was limiting generation.
Application workload 4 100 30s Authenticated POST via script Measure the operation users actually perform.
Sustained run Chosen from prior runs Chosen from prior runs Longer interval Same as the target workload Look for degradation that a short test misses.

The values in this matrix are experimental starting points. Replace them with levels justified by your traffic model, and change one dimension at a time when you need a causal comparison.

Troubleshoot misleading or failed runs

The wrk host reaches 100% CPU

Client-side CPU saturation means wrk may be unable to generate the requested load. Measured latency then includes load-generator limits and scheduling delay. Reduce concurrency, use fewer or better-targeted request-script operations, add another load generator or move the client to a more capable host. Monitor the client and server together before drawing a server conclusion.

Connection attempts fail at the start

The load generator needs enough ephemeral ports, and closed sockets must recycle quickly. Inspect the client’s available port range and socket state using the operating-system tools appropriate to your Ubuntu release. The server’s listen backlog should exceed the number of concurrent connections expected during the initial burst; otherwise, connection establishment rather than request processing becomes the measured bottleneck.

Timeouts appear

Set an explicit --timeout that reflects the operation and report the count with successful latency. Investigate server queues, upstream dependencies, network loss and client saturation. Do not silently discard timeout-heavy runs or compare their request rate with an error-free run.

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

Results vary widely between repeats

Check warm-up, cache state, TLS setup, connection reuse, background jobs, CPU frequency behavior, noisy neighbors and network path changes. Keep the endpoint, request shape and wrk settings fixed, repeat each condition and report the observed distribution. A single average cannot explain run-to-run variability.

Throughput rises while latency becomes unacceptable

That pattern usually indicates that additional concurrency is filling queues. Treat throughput and latency as paired outcomes: identify the point at which the latency limit or error budget is exceeded rather than selecting the highest requests-per-second figure.

A script reports errors unexpectedly

Check the method, URL path, body encoding, content type, authorization state and token lifetime. Test one request manually with the same values before rerunning wrk. Keep response validation in the script when correctness matters, because a fast status-code error should not be counted as a successful transaction.

Report results so another engineer can reproduce them

For every run, save the complete command, wrk version, Ubuntu release, script text or checksum, endpoint and request shape, test start time, client and server hardware, network placement, warm-up procedure, thread and connection counts, duration, timeout, latency statistics, requests and transfer rates, errors, timeouts and relevant system metrics. State whether the result came from a package installation or an upstream build.

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

Present repeated runs together and explain which variable changed. If a result is a local loopback measurement, label it as such; loopback latency cannot stand in for a cross-zone or Internet path. If TLS, a reverse proxy, a cache or a rate limiter sits in front of the application, identify that layer in the test description.

A practical checklist

  • Install and verify wrk with wrk --version.
  • Use an authorized local or staging endpoint first.
  • Warm the service outside the measured interval when appropriate.
  • Start with a documented command such as -t4 -c100 -d30s --latency.
  • Keep URL, method, headers, body, authentication, client, server and network path fixed for comparisons.
  • Change connections, threads, request shape or duration deliberately—not all at once.
  • Watch client and server resources during every run.
  • Record errors and timeouts separately from successful latency.
  • Repeat conditions and retain the full output.
  • Set performance targets from your service’s own requirements; do not borrow the upstream sample numbers.

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
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.