Page tree
Skip to end of metadata
Go to start of metadata

For cPanel & WHM version 64

Overview

Events in cPanel & WHM often cause one or more services to restart. For example, if you add a subdomain, the system restarts Apache and the nameserver daemon. On busy servers, these restart requests can degrade the quality of service.

To handle these requests, cPanel & WHM includes a system to queue and process tasks. It receives requests from subsystems that are aware of the task queue. Because of this, those subsystems do not perform restarts and other requests directly. The task queue system combines multiple instances of an outstanding request into a single action in order to improve server response time.

Note:

The task queue system stores the queue of tasks as JSON files in the /var/cpanel/taskqueue directory. 

 

The servers_queue script

The task queue system uses the /usr/local/cpanel/bin/servers_queue script to queue tasks.

You can use the following arguments when you call the /usr/local/cpanel/bin/servers_queue script:

ArgumentDescriptionExample
queue

Use this argument to pass a quoted command string to add to the task queue. If the system successfully adds that command to the task queue, you will receive a message that resembles the following example:

Id: TQ:TaskQueue:8

In this example, TQ:TaskQueue:8 represents the task's ID number in the task queue.

If you pass an invalid command to the task queue, you will receive the following error message, where command is the command that you specified:

 No known processor for 'command'. at /usr/local/lib/perl5/site_perl/5.8.8/

 

 

/usr/local/cpanel/bin/servers_queue queue 'apache_restart'
unqueue

Use this argument to remove a task from the task queue. When you use this argument, you must pass the tasks's unique task ID number with it. The system outputs this number when you queue a task, or you can find the task ID number in the/var/cpanel/taskqueue/servers_queue.json file.

If the system successfully removes the task, you will receieve a success message that resembles the following example:

1 tasks unqueued 
/usr/local/cpanel/bin/servers_queue unqueue TQ:TaskQueue:3

The queueprocd daemon

The queueprocd daemon, which resides in the /usr/local/cpanel/libexec directory, processes the task queue periodically. The cPanel startup process prompts this daemon. To manage the daemon, use the /usr/local/cpanel/scripts/restartsrv_queueprocd script.

The chksrvd daemon monitors the queueprocd daemon.

Subprocesses that use the task queue

The following subprocesses and related actions issue requests to the task queue system:

ActionRelated cPanel or WHM interface
Create a new account.WHM's Create a New Account interface (Home >> Account Functions >> Create a New Account)
Modify an account.WHM's Modify an Account interface (Home >> Account Functions >> Modify an Account)
Terminate an account.WHM's Terminate Accounts interface (Home >> Multi Account Functions >> Terminate Accounts)
Upgrade or downgrade an account.WHM's Upgrade Downgrade an Account interface (Home >> Account Functions >> Upgrade/Downgrade an Account)
Change the IP address for a site.WHM's Change Site's IP Address interface (Home >> Account Functions >> Change Site's IP Address)
Apache-related functions that are in the Tweak Settings interface.WHM's Tweak Settings interface (Home >> Server Configuration >> Tweak Settings)
Copy an account from another server.WHM's Transfers interfaces (Home >> Transfers)
Add or remove an addon domain.cPanel's Addon Domains interface (Home >> Domains >> Addon Domains)
Create or remove a subdomain.cPanel's Subdomains interface (Home >> Domains >> Subdomains)
Create or remove an alias (parked domain).cPanel's Aliases interface (Home >> Domains >> Aliases)

Additional documentation