Enabling Resource Load Management
This section describes how to configure parameters for resource load management.
- In GaussDB(DWS), you can manage system resources only as a database administrator. Run the following statement to query user permissions:
1 2 3 4 5 6
SELECT rolname FROM pg_roles WHERE rolsystemadmin = 't'; rolname --------- omm Jack (2 rows)
- Resource load management can be applied only to users with the login permission. Run the following statement to query user permissions:
1 2 3 4 5
SELECT rolname FROM pg_roles WHERE rolcanlogin = 't'; rolname --------- omm (1 row)
- If the login permission of a user is revoked, the resource pool of the user is automatically changed to default_pool. For details about default_pool, see Table 2.
- Except the initial user, if enable_gtm_free is enabled and the concurrency of the associated queue is not controlled, user jobs are not managed in resource management. (For uncontrolled concurrency, the resource pool attribute max_dop is set to 0 and active_statements is set to 0. Besides, the global concurrency and resource pool concurrency of users associated with the resource pool are not controlled.)
You can perform the following steps only as a database administrator to enable resource pool-based load management. User omm is used as an example.
- Log in to any host where the GaussDB(DWS) cluster is installed as the OS user omm.
- Enable the Cgroup function.
gs_guc reload -Z coordinator -Z datanode -N all -I all -c "enable_control_group=on"
- Enable resource pool-based load management.
gs_guc set -Z coordinator -Z datanode -N all -I all -c "use_workload_manager=on"
- Enable resident backend thread control for the database.
gs_guc set -Z coordinator -Z datanode -N all -I all -c "enable_backend_control=on"
- Enable control over the autoVacuumWorker thread among the resident backend threads for the database.
gs_guc set -Z coordinator -Z datanode -N all -I all -c "enable_vacuum_control=on"
- Restart the database to make the parameter settings take effect.
gs_om -t stop && gs_om -t start