From users to queries
Queries per second, or QPS, is the rate of requests a system must handle. You derive it from daily activity, not by guessing a number out of the air.
The basic formula
- Take daily active users and the requests per user per day.
- Multiply to get total daily requests.
- Divide by the number of seconds in a day, about 86400.
So one million users doing ten requests each per day is ten million requests, divided by 86400, roughly 120 QPS on average.
Watch the spread
Average QPS hides the truth. Traffic clusters in busy hours, so real peaks can be several times the average. A common rule is to plan for a peak that is two to ten times the daily average.
Knowing both average and peak QPS lets you size servers for the worst minute, not the comfortable average that never reflects reality.
Key idea
QPS comes from users times requests divided by seconds per day, and you must inflate the average to a peak before sizing.