Tips for setting the Dgraph cache size

Set the Dgraph cache size to be large enough to let the Dgraph operate smoothly under normal query load.

You configure the Dgraph cache size initially by setting the DGRAPH_CACHE value in the bdd.conf file in the installation directory. The orchestration script uses this value during the BDD installation process.

After the installation, you can adjust the size of the Dgraph cache by gradually changing the DGRAPH_CACHE value in the bdd.conf file in the $BDD_HOME/BDD_manager/conf directory and use the bdd-admin publish-config command to update the configuration for the entire cluster. For more information, see publish-config.

For enhanced performance, Oracle recommends allocating at least 50% of the node's available RAM to the Dgraph cache. This is a significant amount of memory that you can adjust if needed. For example, if you later find that queries are getting cancelled because there is not enough available memory to process them, you should decrease this amount.

Before you adjust the Dgraph cache, keep this consideration in mind:

While the Dgraph typically operates within the limits of its configured Dgraph cache size, it is possible for the cache to become over-subscribed for short periods of time. During such periods, the Dgraph may use up to 1.5 times more cache than it has configured. It is important to note that the Dgraph does not expect to routinely reach an increase in its configured cache usage. When the cache size reaches the 1.5 times threshold, the Dgraph starts to more aggressively evict entries that consume its cache, so that the cache memory usage can be reduced to its configured limits.

This means that an occasional spike in Dgraph cache usage should not be the cause of alarm and that you should only consider adjusting the Dgraph cache size after observing Dgraph performance over longer periods of time.