Pipelines Scheduling
On this page
If you create multiple pipelines in SingleStore, they will all run in parallel.
Variables |
Description |
---|---|
|
Allows you to specify the maximum number of partitions for each batch. |
|
Allows you to specify the maximum number of pipeline batch partitions that can run concurrently. |
|
Allows you to set the maximum number of pipelines running concurrently. |
Note
The number of partitions that a pipeline uses is dependent on its source.
For example, consider a SingleStore database with 10 partitions.
If the partition requirements, (as set via max_
) of any two pipelines exceed the total number of partitions, each pipeline will be run serially in a round robin fashion.
For example, consider a SingleStore database with 10 partitions, and 3 pipelines.
In this same scenario, if the pipelines_
variable was set to 5, and the max_
variable was not specified, then each pipeline P1, P2, and P3 will be run serially.
You can also use the pipelines_
variable in this scenario.
Pipelines and Resource Pools
Resource pools help isolate and control workloads by grouping queries.MAX_
setting on a resource pool to limit the number of SQL statements that can run simultaneously by reducing system load.
Pipelines waiting in the queue use the thread pool slots reserved for background pipelines based on the settings of MAX_
and MAX_
.pipelines_
engine variable.
When running multiple pipelines in SingleStore, it's important to understand how global and local concurrency controls work together.
-
Global Concurrency Controls:
-
pipelines_
: This engine variable sets the maximum number of pipeline batches that can run concurrently across the entire workspace.max_ concurrent This is a global limit and applies to all pipelines, regardless of the resource pool to which they are assigned. Each pipeline batch can initiate multiple SQL queries. These queries are subject to the limits of their assigned resource pool. If a query is delayed by resource pool constraints, it can block the entire batch from completing. This can prolong its use of a background execution slot controlled by pipelines_
.max_ concurrent This can affect overall pipeline throughput.
-
-
Resource Pools & SQL Query Limits:
-
MAX_
: This variable limits the number of SQL statements that run simultaneously in the pool, helping prevent non-critical workloads from overburdening the system.CONCURRENCY It does not control how many pipelines can run concurrently in a specific pool. -
MAX_
: This variable determines how many SQL queries will be queued for the resource pool onceQUEUE_ DEPTH MAX_
is reached.CONCURRENCY It does not control how many pipelines can run concurrently in a specific pool.
-
-
Pipeline Scheduling and Queuing:
-
Pipelines that are ready to execute but waiting for available concurrency slots consume thread pool resources reserved for background pipelines.
These threads are influenced by the MAX_
andCONCURRENCY MAX_
settings of the resource pool.QUEUE_ DEPTH However, the actual number of concurrently running pipeline batches is controlled by the global pipelines_
variable.max_ concurrent
-
For example,If pipelines_
is set to 4 and you have two resource pools (A and B), no more than four pipeline batches will run at the same time, regardless of how many pipelines are assigned to pools A or B, or their individual MAX_
settings.START PIPELINE
, follows a repeating lifecycle:
execute batch > wait for BATCH_
Pipelines interact with both pipelines_
and the assigned resource pool only during the execute batch phase.
Last modified: August 8, 2025