liveBook · Manning

Load testing

As explained in LLMs in Production

Load testing is a performance-testing technique that evaluates how a service or system behaves under an expected or increasing workload.

Load testing checks whether a service handles its expected workload without unacceptable degradation or failure. Run it before production release or predictable traffic peaks, especially when requests are expensive and resource-intensive. section 6.3.2

A practical load test follows this sequence:

  • Deploy the service in staging, send requests periodically, increase demand until failure or autoscaling, record metrics, and analyze the results. section 6.3.2
  • Track latency and throughput at failure to estimate replica requirements; for streaming responses, also measure time to first token and tokens per second. section 6.3.2

Streaming service test

A Locust user posts a streaming prompt to /generate, counts returned lines, calculates latency, TTFT, and TPS, and writes the measurements to CSV. A run increasing to 50 users at one user per second peaks at 34 requests per second, exposing a service bottleneck.

How LLMs in Production covers it

How deep it goes
Defines a staging-to-analysis workflow and measures latency, throughput, TTFT, and TPS under increasing demand.
Examples
Demonstrates a Python Locust script, CSV metric logging, and a 50-user run that reveals a requests-per-second bottleneck.
What it assumes
Assumes a service deployable to staging and a way to send requests and collect metrics.
What you can do after
Diagnose capacity limits and estimate replicas using latency, throughput, TTFT, and TPS measurements.
How it connects
Connects performance testing with staging environments, latency, throughput, streaming responses, autoscaling, and replica capacity.

Also explained in

Compare how 5 books explain load testing →

Related concepts

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