liveBook · Manning

Wrk

As explained in Latency

wrk is an HTTP benchmarking tool that generates concurrent requests and reports server performance measurements.

wrk is an HTTP benchmarking tool for driving concurrent requests against a running service and measuring latency, throughput, and latency distributions. section 3.5

Use it after starting the REST API, then target an endpoint with a command such as `wrk --latency http://127.0.0.1:8080/hello`. The report includes test duration, threads, connections, average and maximum latency, percentiles, requests per second, and transfer rate.

Comparing database-backed endpoints

A PostgreSQL-backed endpoint reports 1,460.66 requests per second and 5.64 ms median latency, while the SQLite version reports 188,469.82 requests per second and 41 microseconds median latency under the shown test configuration. These figures quantify the performance difference, rather than merely asserting it.

How Latency covers it

How deep it goes
Provides an executable command and interprets averages, percentiles, tails, throughput, and transfer rate, without detailing wrk internals.
Examples
Uses `/hello` benchmarks to compare PostgreSQL and SQLite request rates, median latency, percentile latency, and tail behavior.
What it assumes
Assumes a running HTTP endpoint and requires wrk installation; the surrounding workflow also installs Rust and PostgreSQL.
What you can do after
Evaluate a running HTTP service by generating requests and reading latency, throughput, percentile, and transfer measurements.
How it connects
Connects HTTP benchmarking with REST APIs, latency, throughput, PostgreSQL, SQLite, and latency distributions.

This explainer was generated by Manning's knowledge graph from the text of Latency. The section links point to the parts of the book it draws on.