Skip to main content
Metrics type: Key MetricsCategory: Executive Overview

At a glance

Queries per Second (live) is the rate at which the ClickHouse instance is accepting and executing queries, sampled in real time. For a platform team this is the single pulse that says “how busy is the database right now?” It is the denominator behind almost every other ratio on the board: error rate, slow-query rate, and latency percentiles all read differently at 50 QPS than at 5,000 QPS. A sudden QPS swing, up or down, is usually the first sign that something changed upstream: a deploy, a dashboard storm, a bot, or a stalled ingest pipeline.

Calculation

ClickHouse exposes a monotonic Query counter in system.events that increments every time a query starts. QPS is the delta of that counter over the sampling interval:
The engine reads the Query event at each sample, subtracts the previous sample, and divides by the elapsed seconds to produce the live rate. Because system.events is a server-lifetime cumulative counter, a single reading is meaningless on its own; the rate only emerges from differencing two readings. On a multi-node cluster the card sums per-node rates to give cluster-wide QPS. See the At a glance summary for what the metric tracks and the worked example below for a typical reading.

Worked example

A platform team runs ClickHouse behind a real-time product-analytics dashboard plus an event-ingest pipeline. Normal weekday QPS sits around 800. Snapshot sequence taken on 14 Apr 26 across the morning: The 09:05 spike to 4,900 QPS is six times baseline. Three readings the team should take from this card:
  1. QPS alone never tells you if a spike is good or bad. Six times baseline could be a genuine traffic surge (great), a runaway dashboard with auto-refresh set to 1 second (wasteful), or a bot hammering an unauthenticated endpoint (a problem). To classify it, pair this card with ClickHouse QPS Spike vs Ecom Order Rate. If orders spiked too, it is real demand; if orders are flat, it is a dashboard storm or a bot.
  2. QPS reframes every ratio on the board. At 09:05 the Query Error Rate % card showed 0.8%. At baseline 800 QPS that is roughly 6 failed queries per second; at the spike’s 4,900 QPS the same 0.8% is roughly 39 failed queries per second. The percentage looked stable but the absolute failure volume jumped 6x. Always read error and slow-query percentages against the QPS denominator.
  3. A QPS collapse is as informative as a spike. If QPS suddenly drops toward zero while the application is plainly still serving users, the database is likely refusing connections (check Connection Pool Saturation %) or the ingest pipeline has stalled (check Inserts per Second (live)). A flat-line at zero during business hours is an outage signal, not a quiet period.
The correct response to a QPS spike is to classify before reacting. If ClickHouse QPS Spike vs Ecom Order Rate shows orders rising in step, scale capacity. If orders are flat, find the noisy client in system.processes or system.query_log (group by initial_user or http_user_agent) and rate-limit it rather than scaling the cluster to serve waste.

Sibling cards platform teams should reference together

Reconciling against the source

Where to look in ClickHouse’s own tooling:
system.events for the cumulative Query counter: SELECT value FROM system.events WHERE event = 'Query'. Take two readings a few seconds apart and divide the difference by the elapsed time to reproduce the live rate. system.metrics for the instantaneous Query gauge (queries currently running), which is a different thing: running queries, not arrival rate. system.query_log for a historical, exact count: SELECT count() FROM system.query_log WHERE type = 'QueryStart' AND event_time >= now() - 60 gives queries started in the last minute, divide by 60 for QPS. ClickHouse Cloud console (managed service): the Metrics tab plots query rate per service over time.
Why our number may legitimately differ from a direct query: Cross-connector reconciliation:

Known limitations / FAQs

Why is there no alert threshold on QPS? QPS has no inherently good or bad value. 5,000 QPS is healthy for one cluster and a crisis for another. Alerting lives on the consequence metrics (error rate, latency, saturation), which carry their own thresholds. QPS is the context you read those alarms against, not an alarm itself. What is the difference between the Query event and the Query metric? The Query event in system.events is a cumulative counter of queries started since server boot; differencing it gives arrival rate (this card). The Query metric in system.metrics is an instantaneous gauge of queries running right now. High concurrency (gauge) and high arrival rate (this card) are related but distinct: a few long queries can make the gauge high while QPS stays low. My manual count from system.query_log does not match the card. Why? Two reasons. First, the card samples system.events over a short live interval while the log gives an exact retrospective count, so they differ during bursts. Second, system.query_log only records queries if logging is enabled and not sampled down; if log_queries is off or log_queries_probability is below 1, the log undercounts. The live card reads the event counter directly and is unaffected by log sampling. Does QPS include INSERT queries? Yes. The Query event counts every query start regardless of type. If you want read-only QPS, filter system.query_log by query_kind = 'Select'. For most capacity decisions the combined figure is what matters, because INSERTs compete for the same threads and connections as reads. QPS dropped to near zero during business hours. Is the card broken? Almost certainly not, and that drop is a serious signal. The usual causes are: the connection pool is full and refusing new connections (check Connection Pool Saturation %), the server is overloaded and queries are queuing rather than starting, or an upstream component stopped sending traffic. A genuine zero during business hours is an outage, not a quiet period. How does QPS behave on a multi-node cluster? The card sums per-node arrival rates into one cluster-wide QPS. If load is unbalanced (one node taking most queries), the cluster total can look healthy while one node is saturated. For per-node detail, query system.events on each node directly or use the Cloud console’s per-node view. Does a server restart affect the reading? The Query event counter resets to zero on restart. The engine detects the reset (a sample lower than the previous) and discards that interval rather than reporting a negative rate, so the live card stays clean across restarts. A manual differenced reading spanning a restart would show a misleading negative value.

Tracked live in Vortex IQ Nerve Centre

Queries per Second (live) is one of hundreds of KPI pulses Vortex IQ tracks across ClickHouse and 70+ other ecommerce connectors. Nerve Centre runs the detection layer; Vortex Mind investigates the cause when something moves; Ask Viq lets you interrogate any number in plain English. Start for free or book a demo to see this metric running on your own data.