Inferensys

Glossary

Queries Per Second (QPS)

Queries Per Second (QPS) is a throughput metric that measures the number of complete inference requests a system can process in one second, regardless of request complexity or output length.
Developer building agentic RAG system, retrieval pipeline diagram on laptop, technical workspace with notes.
INFERENCE PERFORMANCE METRIC

What is Queries Per Second (QPS)?

Queries Per Second is a fundamental throughput metric for measuring the raw request-processing capacity of an inference system.

Queries Per Second (QPS) is a throughput metric measuring the number of complete inference requests a system can process in one second, regardless of individual request complexity or output length. It quantifies the raw processing capacity of a model-serving endpoint or an entire inference cluster. QPS is a critical Key Performance Indicator (KPI) for infrastructure scaling and cost analysis, as it directly relates to the economic efficiency of serving a machine learning model. It is often analyzed in conjunction with latency metrics to understand the throughput-latency trade-off of a system.

In performance benchmarking, QPS is measured under a defined Service Level Objective (SLO), such as a maximum acceptable latency, to ensure metrics reflect usable performance. It is distinct from Tokens Per Second (TPS), which measures token-generation speed for language models. System QPS is constrained by hardware limits (e.g., GPU FLOPs, memory bandwidth) and software efficiency, with techniques like continuous batching and KV cache management employed to maximize it. Understanding a system's saturation point, where QPS plateaus and latency spikes, is essential for production capacity planning.

INFERENCE PERFORMANCE METRIC

Key Characteristics of QPS

Queries Per Second (QPS) is a fundamental throughput metric for measuring the raw request-processing capacity of an inference system. Understanding its characteristics is essential for capacity planning, cost analysis, and performance benchmarking.

01

Definition and Core Measurement

Queries Per Second (QPS) measures the number of complete inference requests a system can process in one second. It is a system-level throughput metric that aggregates the completion of all requests, regardless of their individual complexity or output length.

  • Unit of Measurement: Requests/Second.
  • Scope: Measures completed end-to-end requests, from receipt of input to delivery of final output.
  • Contrast with Latency: While latency (e.g., P99) measures the time for a single request, QPS measures the volume the system can handle collectively. They exist in a trade-off relationship, visualized on a throughput-latency curve.
02

Relationship with Other Metrics

QPS does not exist in isolation; it must be interpreted alongside other key performance indicators (KPIs) to provide a complete picture.

  • Tokens Per Second (TPS): For language models, TPS measures token generation rate. A system can have high QPS for short requests but lower TPS if requests are long. QPS * Avg Output Tokens ≈ TPS.
  • Latency Percentiles (P50, P99): As QPS increases toward the system's saturation point, latency typically degrades, especially at the tail (P99). A target QPS must be evaluated against latency Service Level Objectives (SLOs).
  • Hardware Utilization: High QPS with low GPU/CPU utilization indicates inefficiency, while QPS plateauing at 100% utilization identifies a compute-bound or memory-bound bottleneck.
03

Factors Influencing QPS

A system's maximum achievable QPS is determined by a confluence of hardware, software, and workload factors.

  • Model Architecture & Size: Larger models require more FLOPs per token, reducing potential QPS.
  • Inference Optimization: Techniques like continuous batching, KV cache management, and model quantization directly increase QPS by improving hardware utilization and reducing compute per request.
  • Hardware (GPU/CPU): Peak FLOPs and memory bandwidth define the theoretical QPS ceiling.
  • Request Profile: Batch size, input/output sequence lengths, and the variance in these (load distribution) are primary determinants. Homogeneous, short requests yield higher QPS.
  • System Overhead: Network I/O, pre/post-processing, and orchestration framework latency subtract from available compute time, capping effective QPS.
04

Benchmarking and Load Testing

Measuring QPS accurately requires controlled, reproducible benchmarking that reflects production scenarios.

  • Synthetic vs. Real-World Workloads: Benchmarks use synthetic workloads for consistency, but final validation requires real-world workload patterns.
  • Establishing a Baseline: Measure QPS under a target latency SLO (e.g., QPS@P99<200ms) to create a performance baseline.
  • Load Testing: Gradually increase request rate to plot the throughput-latency curve and identify the saturation point where latency spikes.
  • Industry Standards: Benchmarks like MLPerf Inference provide standardized models and datasets for fair QPS comparison across systems.
  • Concurrent Requests: QPS is achieved by processing concurrent requests. Testing must simulate appropriate concurrency levels to expose resource contention.
05

QPS in Cost and Capacity Planning

For CTOs and engineering managers, QPS is a direct input into infrastructure cost models and capacity plans.

  • Cost per Query: Total inference cost divided by total queries over a period. Optimizing to achieve higher QPS on the same hardware reduces cost per query.
  • Capacity Forecasting: Required QPS targets (from product forecasts) dictate the number of instances or GPUs needed. Planning must account for peak load, not just average.
  • Scalability Analysis: QPS should scale near-linearly with added replicas (horizontal scaling) until bottlenecked by shared resources like load balancers or data planes.
  • Budgeting: QPS projections translate directly to cloud compute or hardware procurement budgets under inference cost optimization initiatives.
06

Common Pitfalls and Misconceptions

Misinterpreting QPS can lead to poor architectural decisions and unmet performance expectations.

  • Ignoring Tail Latency: Maximizing QPS without regard for P99 latency leads to poor user experience during traffic spikes.
  • Overlooking Warm-Up: Reporting QPS during steady-state performance without accounting for cold start latency gives an incomplete view of production readiness.
  • Homogeneous Assumption: A QPS number is only valid for a specific request profile. Changing average input length by 20% can change QPS by 40%.
  • Not a Quality Metric: High QPS does not indicate accurate or correct model outputs. It is purely a measure of system throughput.
  • The "Theoretical Max" Fallacy: Peak hardware FLOPs rarely translate directly to achievable QPS due to software overheads, memory bottlenecks, and operator inefficiency.
INFERENCE PERFORMANCE BENCHMARKING

How QPS is Measured and Interpreted

Queries Per Second (QPS) is the primary throughput metric for inference systems, quantifying the number of complete requests processed in one second. Its measurement and interpretation are fundamental to capacity planning and performance optimization.

Queries Per Second (QPS) is measured by submitting a sustained load of requests to a system and dividing the total completed requests by the test duration. A complete request is one where the final output token is delivered. The resulting QPS value is a system-level metric that inherently reflects the complex interplay of batch size, request concurrency, hardware utilization, and model architecture. It is the inverse of the average total request latency when the system is operating at a steady state.

Interpreting QPS requires analyzing it alongside latency metrics, particularly tail latency (P99), as the two form a fundamental trade-off. A reported QPS figure is meaningless without the corresponding load and latency profile. The throughput-latency curve illustrates this relationship: as offered load increases, QPS rises until reaching the system's saturation point, after which latency spikes dramatically while QPS plateaus. Effective benchmarking isolates the QPS achieved while meeting a defined Service Level Objective (SLO) for latency.

QUERIES PER SECOND (QPS)

Frequently Asked Questions

Queries Per Second (QPS) is a fundamental throughput metric for measuring the raw request-processing capacity of an inference system. These questions address its calculation, interpretation, and role in performance benchmarking.

Queries Per Second (QPS) is a throughput metric that measures the number of complete inference requests a system can process in one second. It is calculated by dividing the total number of successfully completed requests by the total measurement time in seconds: QPS = Total Completed Requests / Total Time (seconds). For accurate benchmarking, this measurement is taken during steady-state performance, after initial warm-up, and typically under a sustained load that represents a target concurrent request level. It is a system-level metric that aggregates performance across all hardware components and software layers.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.