github.com/grafana/pyroscope@v1.18.0/docs/sources/reference-pyroscope-architecture/components/query-scheduler/index.md (about)

     1  ---
     2  title: "Pyroscope query-scheduler"
     3  menuTitle: "Query-scheduler"
     4  description: "The query-scheduler distributes work to queriers."
     5  weight: 120
     6  ---
     7  
     8  # Pyroscope query-scheduler
     9  
    10  The query-scheduler is a stateless component that retains a queue of queries to execute, and distributes the workload to available [queriers](../querier/).
    11  
    12  The query-scheduler is a required component when using the [query-frontend](../query-frontend/).
    13  
    14  ![Query-scheduler architecture](query-scheduler-architecture.png)
    15  
    16  [//]: # "Diagram source at https://docs.google.com/presentation/d/1bHp8_zcoWCYoNU2AhO2lSagQyuIrghkCncViSqn14cU/edit"
    17  
    18  The following flow describes how a query moves through a Pyroscope cluster:
    19  
    20  1. The [query-frontend](../query-frontend/) receives queries, and then either splits and shards them, or serves them from the cache.
    21  1. The query-frontend enqueues the queries into a query-scheduler.
    22  1. The query-scheduler stores the queries in an in-memory queue where they wait for a querier to pick them up.
    23  1. Queriers pick up the queries, and executes them.
    24  1. The querier sends results back to query-frontend, which then forwards the results to the client.
    25  
    26  ## Benefits of using the query-scheduler
    27  
    28  Query-scheduler enables the scaling of query-frontends. To learn more, see Mimir [Query Frontend](/docs/mimir/latest/operators-guide/architecture/components/query-frontend/#why-query-frontend-scalability-is-limited) documentation.
    29  
    30  ## Configuration
    31  
    32  To use the query-scheduler, query-frontends and queriers need to discover the addresses of query-scheduler instances.
    33  To advertise itself, the query-scheduler uses Ring-based service discovery which is configured via the [memberlist configuration](../../../configure-server/configuring-memberlist/).
    34  
    35  ## Operational considerations
    36  
    37  For high-availability, run two query-scheduler replicas.