Updated on 2025-05-29 GMT+08:00

Scheduled Task

job_queue_processes

Parameter description: Specifies the number of jobs that can be concurrently executed.

Parameter type: Integer

Unit: None

Value range: 0 to 1000

  • Setting job_queue_processes to 0 indicates that the scheduled job function is disabled and that no job will be executed. (Enabling scheduled jobs may affect the system performance. At sites where this function is not required, you are advised to disable it.)
  • Setting job_queue_processes to a value that is greater than 0 indicates that the scheduled job function is enabled and this value is the maximum number of jobs that can be concurrently processed.

After the scheduled job function is enabled, the job_scheduler thread polls the pg_job system catalog at a scheduled interval. The scheduled job check is performed every second by default.

Too many concurrent jobs consume many system resources, so you need to set the number of concurrent jobs to be processed. If the current number of concurrent jobs reaches the value of job_queue_processes and some of them expire, these jobs will be postponed to the next polling period. Therefore, you are advised to set the polling interval (the Interval parameter of the submit API) based on the execution duration of each job to avoid the problem that jobs in the next polling period cannot be properly processed because of overlong job execution time.

Default value: 10

Setting method: This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Setting suggestion: If there are a large number of concurrent jobs at the same time, a small parameter value will cause job waiting, and a large parameter value will consume more system resources. Therefore, you are advised to set this parameter to 100. You can adjust the parameter value based on system resource usage.

Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.

enable_prevent_job_task_startup

Parameter description: Specifies whether to start the job thread. This parameter can be set at the PDB level.

Parameter type: Boolean

Unit: None

Value range:

  • on indicates that the job thread is not started.
  • off indicates that the job thread is started.

Default value: off. In the PDB scenario, if this parameter is not set, the default value off is used.

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.