Why does the Xray Helm chart DB sync get stuck?

Nimer Bsoul
2019-06-24 10:46

 

Subject

JFrog Xray can be deployed on Kubernetes using our official Helm charts project.
The Helm chart includes multiple ways that Xray can be deployed with different values and resources for Xray services and its third party software (Postgres and mongoDB).

Affected Versions

All versions

Details

During the initialization of Xray, Xray is required to have a full DB sync in order to be efficient and work properly.
While the DB sync is in progress, the mongoDB may consume high resources which can cause the mongoDB pod to get stuck.
In order to avoid such behavior, the mongoDB needs to have sufficient resources, otherwise, (also) the server pod will not be able to function properly.

By default, the embedded mongoDB will inherit from the official mongoDB chart the following resources values:

resources:
 requests:
    memory: 256Mi
     cpu: 100m

mongodbExtraFlags:
- "--wiredTigerCacheSizeGB=1"

**IMPORTANT:** The above values are insufficient to achieve a successful DB sync and needs to be modified with the following values:

resources:
   requests:
        memory: "6Gi"
        cpu: "2"
   limits:
        memory: "6Gi"
        cpu: "2"
mongodbExtraFlags:
- "--wiredTigerCacheSizeGB=3"

The above value can be added by following these steps:

1 – Create mongodb-values.yaml file with the above suggested values.
2 – Upgrade the helm chart: helm upgrade <helm_release_name> --install jfrog/xray -f mongodb-values.yaml

Please note that a restart of the mongoDB pod and Xray server pod, might be required in case the mongoDB pod was already in a stuck state.