Updated on 2022-06-11 GMT+08:00

Optimizing Concurrent Queue Parameters

You can globally or locally control concurrent queues.

Global Concurrent Queue

In a global concurrent queue, max_active_statements controls the number of concurrent jobs on a single CN. All common users' jobs are controlled, regardless of their complexity. When the number of concurrent jobs reaches the specified threshold, the rest of the jobs wait in a queue. Administrator's jobs are not under such control.

Set this parameter based on system capacities, such as memory and I/O usage. In a resource pool associated with common users, if the jobs of different priorities occupy different portions, they will be queued by priority first. Then, the jobs of the same priority are queued. The queue of high priority will be woken up first.

  • If max_active_statements is set to -1, which indicates that global concurrency is not limited, users may be disconnected in a high concurrency scenario.
  • In a point query scenario, set max_active_statements to 100.
  • In an analytical query scenario, set max_active_statements to the number of CPU cores divided by the number of DNs. Generally, its value ranges from 5 to 8.

Local Concurrent Queue

You can locally control the number of concurrent jobs within the same resource pool on a CN. The number of concurrent complex jobs are controlled based on their cost.