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 from various subsystems. Those subsystems do not perform restarts and other requests directly. Instead, the task queue system combines multiple instances of an outstanding request into a single action in order to improve server response time.
queueprocd
daemon, which resides in the /usr/local/cpanel/libexec
directory, processes the task queue periodically. The startup process starts this daemon. To manage the daemon, use the /usr/local/cpanel/scripts/restartsrv_queueprocd
script.chksrvd
daemon monitors the queueprocd
daemon./var/cpanel/taskqueue
directory. The task queue system uses the /usr/local/cpanel/bin/servers_queue
script to manage task queue tasks.
You can use the following arguments when you call the /usr/local/cpanel/bin/servers_queue
script:
Argument | Description | Example | |||
---|---|---|---|---|---|
queue | Use this argument to pass a quoted command string to add to the task queue.
|
| |||
unqueue | Use this argument to remove a task from the task queue. When you use this argument, you must pass the task's unique task ID with it. The system outputs this number when you queue a task, or you can find the task ID number in the If the system successfully removes the task, you will receive a success message that resembles the following example:
|
| |||
schedule | Use this argument to pass a wait time, in seconds, and a quoted command string to add to the task queue. The task queue will not process the command until after the wait time passes.
|
| |||
unschedule | Use this argument to remove a task from the task queue. When you use this argument, you must pass the task's unique task ID with it. The system outputs this number when you queue a task, or you can find the task ID number in the If the system successfully removes the task, you will receive a success message that resembles the following example:
|
| |||
run | Use this argument to perform a synchronous flush of the task queue, which runs all of the task queue's queued jobs immediately. This argument does not return output. |
| |||
help | Use this argument to display usage information for the script. |
|
The following table lists the subprocesses in the /usr/local/cpanel/Cpanel/TaskProcessors
directory that services can pass to the /usr/local/cpanel/bin/servers_queue
script:
Module | Function |
---|---|
ApacheTasks.pm |
|
ApacheTasks.pm |
|
API.pm | verify_api_spec_files |
BackupMetadataConversion.pm | backups_create_metadata |
BackupMetadata.pm | vacuum_metadata |
BackupMountTasks.pm |
|
|
|
BINDTasks.pm | rndc |
CgiCleanupTasks.pm |
|
CheckRPMTasks.pm |
|
CheckRPMTasks.pm |
|
ClamTasks.pm | fresh_clam |
CPAddons.pm |
|
CpDBTasks.pm |
|
CpDBTasks.pm |
|
CpDBTasks.pm |
|
CpDBTasks.pm |
|
cPHulkTasks.pm |
|
cPHulkTasks.pm | add_known_ip_for_user |
cPHulkTasks.pm |
|
cPHulkTasks.pm |
|
cPHulkTasks.pm |
|
Cplisc.pm | check |
CpServicesTasks.pm |
|
CpServicesTasks.pm | restartsrv |
CpServicesTasks.pm | setupservice |
CpServicesTasks.pm | hupcpsrvd |
DAV.pm | dav_change_hostname |
DKIMTasks.pm |
|
DKIMTasks.pm | update_keys |
DKIMTasks.pm | enable_spf_dkim_globally |
DNSTasks.pm | remove_zones |
DovecotTasks.pm |
|
DovecotTasks.pm | flush_entire_account_dovecot_auth_cache |
DovecotTasks.pm | build_mail_sni_dovecot_conf |
DovecotTasks.pm | restartdovecot |
DovecotTasks.pm | reloaddovecot |
EximTasks.pm | buildeximconf |
FilemanTasks.pm | empty_trash |
HordeTasks.pm |
|
HordeTasks.pm | clean_horde_db |
LocaleTasks.pm |
|
LogdTasks.pm | runweblogs |
MydnsTasks.pm | importmydnsdb |
MysqlTasks.pm |
|
MysqlTasks.pm | mysqluserstore |
MysqlTasks.pm | dbstoregrants |
MysqlTasks.pm | dbindex |
MysqlTasks.pm | protecthomecheck |
NameServerIPTasks.pm |
|
NotificationTasks.pm |
|
NotificationTasks.pm | notify_from_subqueue |
PaperLantern.pm | pl_update_users |
PerlModuleTasks.pm | installtaskcpanelcore |
PHPFPMTasks.pm |
|
PHPFPMTasks.pm | enable_fpm |
PHPFPMTasks.pm | rebuild_fpm |
PluginTasks.pm |
|
PluginTasks.pm | uninstall_plugin |
ProxySubdomains.pm |
|
ProxySubdomains.pm | remove_autodiscover_proxy_subdomains |
ProxySubdomains.pm | add_autodiscover_proxy_subdomains |
ProxySubdomains.pm | update_autodiscover_proxy_subdomains |
ProxySubdomains.pm |
|
ProxySubdomains.pm | add_proxy_subdomains |
ResellerTasks.pm |
|
RubyTasks.pm |
|
SpamassassinTasks.pm | enable_spamassassin |
SSLCleanupTasks.pm |
|
SSLCleanupTasks.pm | unset_tls |
SSLTasks.pm |
|
SSLTasks.pm | autossl_check |
SystemTasks.pm | recache_system_reboot_data |
TailwatchTasks.pm |
|
TailwatchTasks.pm | reloadtailwatch |
TailwatchTasks.pm | eximstats_import_sql_file |
TemplateTasks.pm | rebuild_templates |
TestTasks.pm | sleep |
WHMChromeTasks.pm | rebuild_whm_chrome |