- As previously mentioned, the DB sync performance is mostly coupled with your database IOPS, which is why it’s important to meet the system requirements.
- Database connections - By default, Xray requires the following amount of DB connections:
- For Xray server service - 65 connections (60 active connection + 5 idle)
- Indexer, persist and analyze each require 35 connections (30 active + 5 idle). If we combine all three, a total of 105 connections.
For HA we may need to multiply the above with the number of nodes.
As a formula, we summarize it as follows:
Total # of connections = (number of nodes) * (maxOpenConnServer + maxOpenConnPersist + maxOpenConnAnalysis + maxOpenConnIndexer) + 50;
3. In case there are already indexed artifacts on Xray (before the initial onboarding DB sync), it is possible the impact analysis will slow down the DB sync, therefore we can temporarily decrease e the number of workers for the impact analysis. By default, it's 8 workers, and we can decrease these specific workers type to 1 or 2. This can be done with this REST API and requires a restart for Xray afterward. Once the initial DB sync is finished, do not forget to put it back to the original value.
In case of any other issue with the DB sync, we may want to increase the log level for the Server and Persist services to DEBUG through the system.yaml.
For example:
server: logging: application: level: debugSee relevant documentation for additional information.
Note:
In case you are using an old version of Xray, we recommend upgrading Xray to version 3.38.2 or above since these versions contain major performance improvements for the DB sync process.