Skip to content

Queue Workers

Tenantos dispatches various tasks into queues for asynchronous processing. These queues are managed by worker processes that handle tasks such as SNMP operations, backups, and external provider integrations.

This configuration applies to the Tenantos main server only. Tenantos agents do not require adjustments to queue worker configuration.

When to Increase Queue Workers

If you manage many SNMP switches or notice that tasks are pending for an extended period, the number of queue workers may need to be increased.

SNMP-related tasks are particularly sensitive to blocking. When managing many SNMP switches and some switches are unreachable or respond very slowly, the default configuration of 3 workers for the SNMP queue may not be sufficient. Unreachable switches can block workers while waiting for connection timeouts, reducing the overall throughput of the queue. However, in most environments, the default worker count is adequate.

Configuration

Queue workers are configured in /etc/supervisor/conf.d/main-app-worker.conf.

To increase the number of workers for a specific queue, locate the corresponding configuration block and adjust the numprocs value. After making changes, restart Supervisor to apply the new configuration:

systemctl restart supervisor

The custom worker counts you configure will be preserved when installing Tenantos updates.

Default Worker Counts

The default worker counts for each queue are:

  • main: 6 workers
  • snmp: 3 workers
  • external-providers: 6 workers

These defaults are suitable for most installations. Only increase worker counts if you experience persistent queue delays or manage a large number of devices.

Monitoring Queue Performance

If tasks are pending for longer than expected, check the queue status and worker performance before increasing worker counts. High queue delays may also indicate underlying issues such as slow network connectivity, unresponsive devices, or database performance problems.

To check the number of pending jobs in each queue, use the following commands:

redis-cli
SELECT 1
LLEN app_database_queues:default
LLEN app_database_queues:snmp
LLEN app_database_queues:externalproviders

These commands show how many jobs are currently waiting to be processed in each queue.