ansible-role-netbox
ansible-role-netbox copied to clipboard
Support for Deployment of Multiple RQ Workers
It's possible, particularly now with plugins, to have a need for multiple rq-workers
in the environment to process all the background tasks simultaneously. The default one-worker deployment could fall behind if multiple reports, scripts, and other tasks are queued at the same time. Plugins can introduce even more complex workflows that may take longer to run.
The good news is rq
supports deploying multiple workers quite easily and without making any code changes to NetBox itself. The systemd
method of doing so is documented in the official docs.
to start workers by invoking
systemctl start [email protected]
, systemctl start [email protected] from the terminal.You can also reload all the workers by invoking
systemctl reload rqworker@*
.
I'm imagining a simple setting like netbox_rqworker_count = 1
as the default. Users could change it to 4
, which would start & enable rqworker@1
, rqworker@2
, rqworker@3
, rqworker@4
.