Class and Scheduler Name
How It Works
The scheduler:- Queues incoming server query requests in first-come, first-served order.
- Schedules up to the current maximum allowed running queries.
- Checks JVM memory usage with
Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(). - Enters throttling when used memory is above the configured percentage of
Runtime.getRuntime().maxMemory(). - Caps the maximum allowed running queries to the number already running, with a minimum of one.
- Slowly increases the maximum allowed running queries after the memory condition clears.
- Requests JVM garbage collection if throttling is sustained.
Enable the Scheduler
Set the scheduler name in the Pinot server configuration:Configuration
Example:
Tuning Example
For a server with a 16 GB JVM heap and a threshold of90, throttling begins when used heap is above roughly 14.4 GB:
- Already-running queries continue.
- New queries wait in the scheduler queue.
- The scheduler lowers the maximum allowed running queries to the current running query count, with a minimum of one.
- After memory usage drops below the threshold, the scheduler increases the allowed running-query count by one per update interval until it reaches the query runner thread count.
Full Server Config Example
Metrics to Watch
The scheduler updates StarTree server gauges for query scheduling and throttling:
Healthy behavior after a short spike is:
QUERY_THROTTLING_SINCE_MSbecomes non-zero.QUERY_MAX_ALLOWED_QUERIESdrops.- Memory usage falls.
QUERY_THROTTLING_SINCE_MSreturns to zero.QUERY_MAX_ALLOWED_QUERIESramps back towardQUERY_NUM_RUNNER_THREADS.
Operational Guidance
- Start with a threshold between
85and95, then tune from observed query latency and heap pressure. - Prefer fixing query memory regressions or oversized result sets before relying on scheduler throttling.
- Keep enough broker and client timeout budget for queued queries.
- Avoid setting the threshold too low on latency-sensitive clusters; it can queue queries even when the JVM has usable headroom.
- If throttling is continuous, add capacity, reduce per-query memory, lower concurrency, or investigate memory leaks.

