Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve memory usage of arangodb process #198

Open
abramsymons opened this issue Mar 3, 2021 · 3 comments
Open

Improve memory usage of arangodb process #198

abramsymons opened this issue Mar 3, 2021 · 3 comments

Comments

@abramsymons
Copy link
Collaborator

@TripleSpeeder reported that arangodb is using around half of 32GB dappnode memory.

screenshot-snapshot raintank io-2021 03 03-14_16_59

It seems we have some sort of problem in garbage collection that is related to new transnational mechanism we are using in latest release to cache queries and speed up things when there are high number of queries that should run. Node one is also using around half of its 4G memory.

@TripleSpeeder
Copy link
Collaborator

I think this is not a bug, but rather expected behaviour. After reading https://www.arangodb.com/docs/stable/tutorials-reduce-memory-footprint.html and especially https://www.arangodb.com/docs/stable/programs-arangod-rocksdb.html#write-buffers it looks like the RAM usage is mostly rocksdb write buffers.

By default rocksdb.total-write-buffer-size is calculated as (system RAM size - 2GiB) * 0.5. With 32GB on my machine this results in the observed 15GB RAM used.

I'm extending the DappNode package setup to allow setting additional parameters to running arangodb, allowing to modify the RAM usage behaviour.

@TripleSpeeder
Copy link
Collaborator

Running with --rocksdb.total-write-buffer-size 4294967296 (4GB) does not show any difference in RAM usage. Attached image shows RAM usage before and after restart with this option.
image
I continue exploring other options.

@TripleSpeeder
Copy link
Collaborator

Looks like the read cache is using up most of the space. Limiting read cache to 2Gigabyte with --rocksdb.block-cache-size 2000000000 --rocksdb.enforce-block-cache-size-limit true results in overal memory usage capped at ~4GB:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants