While the amount of virtual memory consumed by the Dgraph process
may grow and even exceed RAM at times, it is important for performance reasons
that the working set size of the Dgraph process does not exceed RAM.
The following diagram illustrates this relationship:
In this diagram:
- RAM is the amount of
physical memory
- VM is the Dgraph process
virtual memory usage
- WSS is the Dgraph process
working set size
The diagram illustrates three distinct use cases:
- Typical operation with
normal memory saturation. The graph on the left side illustrates the case
where the amount of virtual memory used by the Dgraph process completely fits
into RAM and thus the working set size of the Dgraph process also fits into
RAM. This is a standard situation under which the Dgraph maintains its optimal
performance.
- Typical operation in an
out-of-memory situation. The graph in the middle illustrates the case
where, while the amount of virtual memory exceeds RAM, the working set size of
the Dgraph process fits into RAM. In this case, the Dgraph also maintains its
optimal performance.
- Potentially I/O bound
operation with poor performance where WSS starts to exceed RAM. The graph
on the right side illustrates a situation that you should avoid. In this case,
both the amount of virtual memory consumed by the Dgraph and the working set
size of the Dgraph exceed RAM. Two situations are possible in this scenario
that are of particular interest to you: the WSS can start to exceed RAM mildly
or significantly. Subsequently, the degradation in I/O performance can also be
mild or significant. Identify the level of I/O performance that is acceptable
to your implementation. Depending on the acceptable I/O performance, you can
decide whether you need to address the situation with WSS exceeding RAM. In
general, if WSS starts to considerably exceed RAM, this causes Dgraph
performance to drop dramatically.