Guide

Load testing and capacity

A load test answers two questions: how much traffic can this setup take, and what does each token cost?

Workload shape

Test with traffic that looks real. The workload shape is the mix of prompt lengths, answer lengths and the arrival rate (requests per second). Real prompts vary: many short, a few very long. Take the lengths from logs of real traffic, not one prompt sent 1,000 times.

Open and closed loop

In a closed-loop test, a fixed number of users each send a request and wait for the answer before sending the next. When the server slows down, they send less, so the load drops just when it matters. In an open-loop test, requests arrive at a set rate, whatever the server does. Public traffic behaves more like this, so open loop shows overload honestly.

Finding the knee

Raise the load step by step: 1, 2, 4, 8 requests a second. At first latency stays flat. Then requests arrive faster than they finish, a queue builds, and latency climbs sharply. That bend is the knee. Your capacity is the highest load that still meets your SLO, just before the knee.

Finding the memory limit

Memory has a hard edge. Test many users at once with the longest context you allow, and find where the server runs out of memory (OOM). Then set limits below that point, so real users never reach it.

Cost per token

Cost per million tokens = GPU cost per hour ÷ millions of tokens per hour. A GPU at $3.60 an hour making 1,000 tokens a second makes 3.6 million tokens an hour, so each million costs $1. Use the rate you can serve within your SLO, not the peak an overloaded GPU reaches.

Remember

  • Test with real prompt and answer lengths.
  • Open loop shows overload; closed loop hides it.
  • Capacity is the load just before the knee, within SLO.
  • Find the OOM point before users do.
  • Price tokens at the rate that meets the SLO.