When a Loki query scheduler becomes the right move
A separate query scheduler is worth planning when a single query-frontend has stopped being a comfortable place to queue work. In a small cluster, the frontend holds the queue of incoming queries in its own memory and hands them to queriers. As query volume grows, that single process becomes both a bottleneck and a single point of failure: queries pile up behind it, and losing it interrupts every query in flight. The signs usually show up as rising query latency at busy hours, frontend memory growth, or an operations team that wants more than one frontend but cannot run more than one today.
The Loki documentation describes the fix. The query-scheduler takes over the queue that the query-frontend would otherwise hold in memory, which allows you to run several query-frontends. Frontends and queriers are then both pointed at the scheduler's address, so each component can be scaled or restarted without losing the queue. Before you commit, confirm the exact query_scheduler and frontend settings for your Loki version in the Loki documentation on larger production deployments, and confirm that your deployment mode and object storage setup are the ones the guidance assumes.
Two benefits follow from the design, and they are the reasons teams usually adopt it. First, a scheduler that tracks in-flight requests gives the autoscaling work a signal for querier demand, which is what the sibling topic on KEDA relies on. Second, queue fairness depends on a shared queue, so a heavy tenant or one large query cannot easily starve others when work is queued centrally. Ask your team to confirm which fairness and limit settings your version supports before you plan tenant behavior around them, and treat the scheduler as one step in a wider capacity plan rather than a fix on its own.
Query path with a separate query-scheduler
The diagram starts at clients sending LogQL requests to a load balancer behind the authenticating reverse proxy, which marks the trust boundary. Requests then fan out across several query-frontends, which hand work to the query-scheduler instead of holding their own queues. Queriers pull work from the scheduler and read chunks and the index from shared object storage. Check that every frontend and querier points at the same scheduler address, and that nothing reaches the queriers without passing the proxy.
Query path from clients through the scheduler to queriers and object storage.
Scheduler options and when each fits
This table compares three ways to place the query queue: inside a single query-frontend, in a separate query-scheduler feeding one frontend, and in a separate scheduler feeding several frontends. Read each column for what it supports, what configuration it needs and what extra component you must operate. The main takeaway is that the separate scheduler is the step that makes multiple frontends and queue-based querier autoscaling possible.
| Option | What it supports | Configuration needed | Components to operate |
|---|---|---|---|
| Queue inside one query-frontend | One frontend handling all queries, with the in-memory queue held by that process | Frontend and queriers point at the frontend address only; no scheduler setting | Frontend and queriers; a frontend restart drops its queued requests |
| Separate scheduler, one frontend | Queue moved out of the frontend, so the scheduler holds the queue while one frontend serves queries | Frontend and queriers both set the scheduler address; scheduler runs as its own process | Scheduler added alongside the frontend and queriers; one more process to monitor and restart |
| Separate scheduler, several frontends | Multiple query-frontends sharing one queue, so frontend capacity can be scaled out | All frontends and all queriers point at the same scheduler address; scheduler must be reachable from every frontend | Scheduler, several frontends and queriers; a load balancer or DNS entry to spread query traffic across frontends |
| Querier autoscaling signal | Queue and in-flight request metrics from the scheduler can drive querier scaling | Scheduler metrics scraped and exposed to your autoscaler, such as KEDA | Metrics pipeline and autoscaler in addition to the scheduler; confirm the metric names in your Loki version |
| Query fairness across tenants | Per-tenant queueing in the shared scheduler queue, so one tenant's backlog does not fully block others | Per-tenant limits and queue settings on the scheduler; confirm the options for your release | Tuning effort on the scheduler and limits; review after tenant mix changes |
| Failure impact of the queue process | Single frontend: a frontend failure takes query intake down; shared scheduler: a scheduler failure stalls queued queries | Run more than one replica where supported and confirm the high-availability settings for your version | Health checks, restart policy and alerts on scheduler queue length |
| Best fit | Small clusters with light query load and no autoscaling plans | Moderate query load that needs a separate queue but a single frontend is enough | Larger clusters with several frontends, autoscaling or tenant fairness requirements |
How to set up the query-scheduler
This sequence moves the query-frontend's queue into a standalone query-scheduler so that several frontends can run, and it confirms that queries pass through the scheduler before anything else depends on it. Each step ends with a check you can run before moving on.
Confirm your Loki version and deployment mode
Before changing anything, confirm which Loki release you run and how it is deployed, because the scheduler settings live in the query-frontend and querier configuration of that release. Check the current Loki documentation on managing larger production deployments and note the exact key names for your version, including the query-scheduler address and frontend settings. Record which deployment mode you use, since simple scalable mode is being deprecated and will be removed with the Loki 4.0 release. You are done when you have a written list of the keys to set and the version they were confirmed against.
Deploy the query-scheduler process
Run the query-scheduler as its own process or pod with the same Loki configuration file and object storage access as the other query components, so it can reach the cluster's shared settings. Give it a stable network address that frontends and queriers can resolve, such as a Kubernetes service name on a single-binary or scalable setup. Confirm the scheduler's listening port and its gRPC settings against the docs for your version. You are done when the process starts, stays running, and logs that it is listening on the address you planned.
Point query-frontends at the scheduler address
Edit the query-frontend configuration so it sends queued requests to the scheduler rather than holding its own in-memory queue. Set the frontend's scheduler address key to the stable address from the previous step, and confirm the exact key names in the current docs for your Loki release. Restart or roll the frontends so they load the new settings. You are done when each frontend logs a successful connection to the scheduler and none of them report that the scheduler address is unreachable.
Point queriers at the same scheduler address
Update the querier configuration so every querier connects to the same scheduler address the frontends use, and confirm the querier-side key that names the scheduler in the docs for your version. Queriers pull work from the scheduler, so a querier pointed at the wrong address will sit idle while queries wait. Roll the queriers after the frontends are updated. You are done when each querier logs a connection to the scheduler and the scheduler reports the queriers as registered.
Verify that queries flow through the scheduler
Run a known LogQL query through a frontend and watch the scheduler logs and the query-scheduler metrics that Loki exposes for queue length and in-flight requests, using the metric names listed in the current docs. Check that the query returns results, that the queue drains, and that queriers receive the work. Repeat the test through a second frontend to confirm that more than one frontend can use the scheduler. You are done when both frontends return results and the scheduler shows the requests passing through it.
Confirm the settings that depend on the scheduler
Record the final configuration, then confirm the settings that rely on the scheduler: querier autoscaling and per-tenant query fairness both read queue and in-flight data from it. Check the autoscaling sibling guidance and your limits configuration for the tenant queue behavior your version supports. Store the confirmed key names and the metric names in your runbook so that later upgrades can be checked against them. You are done when the runbook lists the confirmed configuration and the monitoring you will use to watch the scheduler.
Security and operational considerations
A separate query-scheduler adds a hop between frontends and queriers, and the query path sits behind an authenticating proxy that Loki does not provide itself. The cards below cover the network paths, the proxy, the tenant header and the signals to watch during an incident, so the scheduler is hardened as part of the query path rather than treated as internal plumbing.
Network paths between components
Frontends open connections to the scheduler, and queriers connect to it to pull work, so the scheduler address must be reachable from both tiers and from nothing else. Keep these paths on the cluster network or private subnets, and restrict ingress to the scheduler's gRPC port with network policies or security groups. Confirm which ports your version uses for scheduler and querier traffic before writing the rules, and check that frontends never reach queriers directly once the scheduler is in place.
Scalability docsAuthenticating reverse proxy
Loki has no built-in authentication layer, so the query-frontend endpoint must sit behind an authenticating reverse proxy such as nginx, HAProxy, OAuth2 Proxy or Pomerium. The scheduler and queriers should never be published through that proxy at all. Confirm that the proxy rejects unauthenticated requests before they reach the frontends, and that its logs record the identity behind each query for later review.
Authentication docsTenant header pass-through
When auth_enabled is true, every request carries the X-Scope-OrgID header, and the scheduler path must forward it unchanged from frontend to querier. A proxy or ingress that strips, rewrites or overwrites this header will silently send queries to the wrong tenant or reject them. Set the header from the authenticated identity in the proxy rather than trusting the client, and test a cross-tenant request in staging after every proxy change.
Scheduler queue signals
During an incident, watch the scheduler's queue length and the time queries spend waiting before a querier picks them up. A growing queue with idle queriers points to a connection or addressing fault, while a growing queue with busy queriers points to undersized capacity or a few heavy queries. Compare these signals against frontend error rates and querier restarts, and confirm the metric names exposed by your Loki version before building dashboards or alerts.
Frontend and querier health
Track how many frontends are connected to the scheduler and how many queriers are registered and pulling work. A frontend that has lost its scheduler connection will return errors even though the scheduler itself is healthy, and a querier that has dropped out reduces capacity without an obvious failure. Include both counts in your runbook so responders can tell a partition from an overload within minutes.
Change and rollback checks
Changes to scheduler addresses, proxy rules or querier counts should be rolled out in a fixed order, with a documented rollback that restores direct frontend-to-querier queuing if the scheduler misbehaves. Before each change, record the expected scheduler address, the tenant header behavior and a set of test queries. Reconfirm these checks after every Loki upgrade, since defaults and configuration keys can change between releases.
How the scheduler supports querier autoscaling and fairness
Querier capacity should follow query demand, which rises during working hours and falls overnight. When each frontend keeps its own queue, no single component sees how much work is waiting across the cluster, so an autoscaler has no reliable picture of demand. A separate query-scheduler sends every query through one component that can report how many requests are in flight. That shared signal is what lets an autoscaler add or remove queriers in step with load. The sibling topic on KEDA covers the scaler setup in detail.
- One place to read demand: The scheduler sees queued and dispatched queries from every frontend, so the signal describes the whole cluster.
- In-flight requests drive scaling: An autoscaler such as KEDA can add queriers when the in-flight count climbs and remove them when it falls.
- Scale-down must wait for work to finish: Stopping a querier that is still running a long query can interrupt that request, so scale-down settings need to give in-progress queries time to complete.
- Frontends stay small: Queueing moves out of the frontend, so frontends can be sized for connections while queriers are sized for compute.
Before enabling autoscaling, confirm that the scaler can read the scheduler metric, that every querier points at the scheduler address, and that your longest expected query fits inside the scale-down window.
On a shared cluster, one team running wide, slow queries can delay every other team if all requests wait in one first-in, first-out line. The scheduler keeps a single queue that can see which tenant each request belongs to, which is the basis for sharing queriers fairly across tenants. Tenant identity comes from the X-Scope-OrgID header that Loki reads on every request when authentication is enabled. Fairness depends on the queue being shared, so it is a direct result of the scheduler design.
- Shared queue is the prerequisite: Frontends that each hold their own queue cannot compare tenants, so fairness depends on a common scheduler.
- Tenant identity separates the work: The org ID on each request is what distinguishes one tenant's queries from another's.
- Fairness does not cap query size: Sharing queriers spreads waiting time but does not limit how large one query can be, so per-tenant query limits still need setting.
- Shuffle sharding for stronger isolation: When one tenant's load must stay off other tenants' queriers, the sibling topic on shuffle sharding is the next step.
Check that tenant IDs reach the scheduler unchanged through your reverse proxy, and that per-tenant query limits match each team's agreed use. Confirm the exact queueing behavior for your Loki version in the Loki scalability documentation.
Fair queueing spreads waiting time, but every tenant still draws on the same pool of queriers. When a heavy tenant can saturate that pool, other tenants still feel the effect. Shuffle sharding gives each tenant a subset of queriers so that a burst or failure stays largely within that subset. The scheduler makes a shared pool workable in the first place, but choosing subset sizes is a separate design decision with its own trade-offs.
- Subset size sets the blast radius: Smaller subsets isolate tenants more tightly but leave each tenant fewer queriers to absorb its own bursts.
- Subsets overlap by design: Tenants share some queriers, which limits the chance that a failure removes all capacity from one tenant.
- Autoscaling and subsets interact: A subset that scales with a shared metric may need review, so test scaling again after any subset change.
- Configuration is per component: Sharding settings apply to queriers and frontends separately, and the sibling topic covers each component's settings.
Before changing subsets, identify the tenants generating the heaviest queries, measure their patterns during a load test, and confirm the setting names and defaults for your Loki version.
Limits and what to confirm in your environment
A separate query scheduler changes how queued work flows between frontends and queriers, so the version, deployment mode, memory budget and downstream stores all need checking first. The cards below list what to confirm before you change the topology, and each one feeds the sizing and rollout decisions that follow.
Loki version and scheduler support
Confirm the Loki version you run and the scheduler settings its documentation describes for that release. The current release listed on the Loki GitHub releases page is v3.7.8, but your cluster may be on an older line, so check the configuration keys against your own version before editing query_scheduler_address on frontends and queriers. Plan the change as a versioned config change, not a live tweak.
Deployment mode in use
Identify whether you run monolithic, simple scalable or microservices mode, because the frontend and scheduler roles differ between them. Simple scalable mode is being deprecated and will be removed with the Loki 4.0 release, so a scheduler built around it may need a second migration later. Ask the team that owns the cluster which mode it runs and whether a move to microservices is planned.
Deployment modes docsQueue size against frontend count
Each additional query frontend adds its own queue, and the scheduler holds queued requests in memory, so frontend count and queue size together set the memory ceiling. Measure current queue depth and memory under peak load, then model the increase for each extra frontend before raising any limit. Ask your team to confirm the queue size they will use and the memory headroom on the scheduler host or pod.
Object store concurrency headroom
More frontends and queriers mean more parallel reads against object storage for chunks and index data. Confirm with your storage provider the request rate and throttling behavior your bucket or S3-compatible store allows, and check that your provider's limits are not the new bottleneck. Self-hosted S3-compatible stores and local filesystems are supported but not typically recommended for production, so weigh that when reviewing capacity.
Loki storage docsCache capacity under added concurrency
Results and chunk caches absorb repeated reads, and their hit rates shift when more queries run in parallel. Check whether your caches still hold the working set at peak concurrency, and whether eviction rates rise after the change. Confirm which cache backend you run and its memory allocation, since a cache that was sized for fewer frontends may stop helping under the new load.
Monitoring and rollback plan
Before you change the topology, agree which metrics will show whether the scheduler helps: queue wait time, in-flight requests, querier utilization and error rates on frontends. Also define a rollback path that returns frontends to their in-process queue if the scheduler misbehaves. Ask your team to confirm who owns the dashboards and who approves the rollback.
Questions teams ask before running a query-scheduler
Do I need a separate query scheduler if I run only one query-frontend?
Usually not on day one. A separate query-scheduler exists so that several query-frontends can run against one shared queue, which matters when a single frontend becomes a throughput or availability bottleneck. With one frontend, the in-memory queue inside that frontend already works. The decision point is the plan for growth: if you expect to add frontends for capacity or redundancy, or if you want querier autoscaling driven by queue state, plan the scheduler early, because moving it later means changing the address that every frontend and querier points to. Confirm your query volume and concurrency in your own environment before deciding, and test the change in a non-production cluster first.
How much effort does a query-scheduler setup take, and who does the work?
The configuration change itself is small: you run the scheduler as its own process, point the query-frontends and queriers at its address, and remove the queue settings that no longer apply on the frontend. The larger effort is around it: updating Helm values or deployment manifests, validating that every component reads the same configuration, and checking query behavior and metrics before and after the cut. Your platform team owns the cluster and the rollout, and the Loki administrators own the configuration. A partner typically takes on the design, the change plan, the test runs and the documentation, while your team keeps control of production changes. The effort is driven mainly by how many components you run and how much of the deployment is templated. Ask any provider for a written scope listing each component touched and each verification step.
How long does a query-scheduler rollout take?
No researched figure supports a specific duration, so treat any number you hear as a claim to verify. The timeline depends on the environment. A single Kubernetes cluster with Helm-managed Loki, a staging copy and an agreed change window is the simplest case. Timing grows with the number of clusters, the presence of separate staging and production, how often configuration is changed through approvals, and whether you also plan autoscaling or other scaling work in the same window. Organizations with strict change control need time for review and rollback rehearsal. Ask for a timeline that separates design, staging validation, production change and post-change observation, and confirm each stage with the people who approve changes.
What must our team provide before a query-scheduler project starts?
Three things determine how smoothly the work goes. First, cluster access: credentials or a deployment pipeline with rights to change the Loki workloads in each environment, and read access to logs and metrics so you can confirm query behavior. Second, network design: the scheduler, frontends and queriers must reach each other on the addresses you configure, and any network policy or service mesh rules must allow that traffic. Third, Loki version and configuration management: you need to know the exact Loki version in each environment, where configuration lives (Helm values, Git repository or hand-edited files), and who approves changes. Check the current Loki release notes against your version before the change, since the deployment modes and components documented for your version determine which settings apply.
Can our own team run a query-scheduler without outside help?
Yes, if your team already operates Loki and manages its configuration in version control. The change is contained: a new process, updated addresses on frontends and queriers, and validation through queries and metrics. Teams without recent Loki experience often find the harder part is verification, such as confirming that queries still succeed under load, that queue metrics appear as expected and that rollback works. Decide honestly whether you have someone who can own the change end to end, and whether you have a staging environment that resembles production. If not, an outside partner can cover design, test and documentation while your team keeps operational control.
What does a query-scheduler change cost, and what recurs afterward?
The cost has two parts. The one-time part covers design, configuration changes, staging tests, the production change and documentation, whether done by your staff or a partner. The recurring part covers keeping the setup correct as Loki is upgraded, as configuration evolves and as autoscaling or other scaling features depend on the scheduler's metrics. Costs go up with the number of clusters, the number of Loki environments, the maturity of your change process and the amount of work needed to bring configuration into version control. No price figures are supplied for this work. Ask any provider for a written quote that lists one-time and recurring items separately, and ask what is excluded, such as upgrades or on-call support.
Does the query-scheduler change affect data retention, tenant isolation or access control?
The scheduler handles query routing, not storage, so it does not change where logs are kept or how long retention runs. Retention is applied by the compactor and is disabled by default unless retention_enabled is set, so confirm that setting separately if you rely on it for compliance. Tenant isolation depends on auth_enabled and the X-Scope-OrgID header, which must still reach the query path after the change. Loki has no built-in authentication layer, so an authenticating reverse proxy must still sit in front of the query path. Review these settings in staging, because a change in routing can expose a misconfigured header or proxy rule that was previously hidden.
What should we verify after the scheduler goes live?
Verify three things. First, that every query-frontend and querier connects to the scheduler address and that no component still uses the old in-frontend queue. Second, that queries succeed for each tenant and that results match the pre-change baseline for a set of known queries. Third, that the scheduler's queue and in-flight metrics appear in your monitoring, since autoscaling and fairness decisions rely on them. Keep the previous configuration ready for rollback during an agreed observation window. Confirm the exact metric names and dashboards against the Loki version you run, rather than relying on names from older guides.
How DeployOpen scopes and delivers scheduler changes
DeployOpen scopes a query-scheduler change in writing before any configuration is touched. The first step is a review of the current topology: where the query-frontend runs, how many queriers are attached to it, which Loki version and deployment mode is in use, and how the frontend's in-memory queue is currently sized and monitored. From that review we agree the target number of frontends and queriers, the address the scheduler will listen on, and the configuration keys that will change on frontends, queriers and the scheduler process. The written scope also states who approves each change window, how a rollback is performed, and which environments (test, staging, production) the work covers. All of this runs inside your cloud accounts, data centers or air-gapped network, with access granted to your team's systems and no copies of your logs leaving your environment.
Delivery follows the agreed scope in stages. Configuration is applied to a non-production cluster first, then the frontends are scaled out and the queriers are pointed at the scheduler address. Verification focuses on evidence your team can keep: query success and latency before and after the change, queue depth reported by the scheduler, and confirmation that every querier appears as connected. DeployOpen then hands over the final configuration, the runbook for adding frontends or queriers later, and a short list of the metrics and alerts to watch. Your team confirms in the scope which settings must match your existing monitoring and change-management process. If your platform team wants help beyond handover, such as tuning after autoscaling is introduced or reviewing the scheduler after a Loki upgrade, that work can be covered by an ongoing support retainer agreed separately in writing.

