Queue Workers

XRAY: How to tune Xray for heavy loads?

AuthorFullName__c
Ariel Kabov
articleNumber
000004533
ft:sourceType
Salesforce
FirstPublishedDate
2019-08-25T06:48:45Z
lastModifiedDate
2022-11-12
VersionNumber
8
The Queue Worker parameters define how many parallel messages the corresponding Xray microservice can handle. For instance, the “Index” worker count defines how many packages each Indexer node can process at the same time.

By default, Xray starts with queue workers set to 8 for New Content, and 4 for Existing Content.
In Xray 2.X versions 2.9.0 to 2.16, you can set the worker value via the UI. In the 3.X versions Artifactory's Unified UI is what is used.

In Artifactory version 7.11 and below, this is configurable via the Xray UI, at Admin → General.
In Artifactory version 7.12 and above, this is configurable only via the REST API.

REST API Example:

#Defaults:
# New Content: 8 workers
# Existing Content: 4 workers
curl -X PUT -H"Content-type: application/json" -u admin http://localhost:8082/xray/api/v1/configuration/workersCount --data '{
     "index": {
         "new_content": 16,
         "existing_content": 8
     },
     "persist": {
         "new_content": 16,
         "existing_content": 8
     },
     "analysis": {
         "new_content": 16,
         "existing_content": 8
     },
     "alert": {
         "new_content": 16,
         "existing_content": 8
     },
     "impact_analysis": {
         "new_content": 8
     },
     "notification": {
         "new_content": 16
     }
 }'

 
Do not forget that each worker is a separate Goroutine (as Xray is written in Go), so a high worker value will be limited by the available CPU cores.

Important: By increasing the “bin_mgr_workers” we allow Xray to open more concurrent connections to Artifactory, resulting in more concurrent downloads.
A high value here can also impact the Artifactory instance, therefore it is important to monitor Artifactory as well. (Consider tuning Artifactory as well)

*Depending on the scale, you might need to modify the RabbitMQ Virtual Host limit.
To do so run the following on the RabbitMQ host (will allow unlimited number of connections):
rabbitmqctl set_vhost_limits -p / '{"max-connections": -1}'