Overview
parallel_servers_target specifies the parallel query queuing conditions for each server.
When the total number of threads consumed by multiple Parallel eXecution (PX) SQL statements exceeds the parallel query queuing threshold, subsequent PX SQL statements must wait in a queue.
Privilege requirements
Query variables
Both the
systenant and all user tenants can use theSHOW VARIABLESstatement and theinformation_schema.GLOBAL_VARIABLESview to view the values of global system variables.Modify variables
The
systenant can directly modify the values of global system variables.You must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.
Attributes
Attribute |
Description |
|---|---|
| Parameter type | Int |
| Default Value | 0: No special meaning. This value is automatically set when the tenant is created. |
| Value range | [0, 9223372036854775807] |
| Effective Scope | Global |
| Modifiable | Yes, you can use theSETStatement modification. |
Usage instructions
parallel_servers_target is a tenant-level variable. It is set when you create a tenant:
If the
parallel_servers_targetvalue is specified in the tenant creation statement, the tenant'sparallel_servers_targetis set to this specified value.The statement for specifying the
parallel_servers_targetvalue when creating a tenant is as follows:obclient> CREATE TENANT IF NOT EXISTS <tenant_name> CHARSET='utf8mb4', ZONE_LIST=('zone1'), PRIMARY_ZONE='zone1', RESOURCE_POOL_LIST=('<pool_name>') set parallel_servers_target = 624;If the
parallel_servers_targetvalue is not specified when creating a tenant, it will be automatically calculated based onmin_cpuduring the process of creating the tenant on the OBServer node.Log in to the tenant and execute the following statement to view this value:
obclient> show variables like 'parallel_servers_target';The automatically calculated value of
parallel_servers_targetis usually small and can only meet simple parallel query requirements. If you want to use parallel operations in this tenant, it is recommended to manually set this value to a larger number. The recommended algorithm isparallel_servers_target = max_cpu * 10.
Configuration example
Set the parallel query queue size on each server to 624.
obclient> SET GLOBAL parallel_servers_target = 624;