Operating System Configuration
We recommend to not use BTRFS on linux, it’s known to not workwell in conjunction with ArangoDB. We experienced that arangodbfacing latency issues on accessing its database files on BTRFSpartitions. In conjunction with BTRFS and AUFS we also saw data losson restart.
Virtual Memory Page Sizes
Linux only
By default, ArangoDB uses Jemalloc as the memory allocator. Jemalloc does a goodjob of reducing virtual memory fragmentation, especially for long-runningprocesses. Unfortunately, some OS configurations can interfere with Jemalloc’sability to function properly. Specifically, Linux’s “transparent hugepages”,Windows’ “large pages” and other similar features sometimes prevent Jemallocfrom returning unused memory to the operating system and result in unnecessarilyhigh memory use. Therefore, we recommend disabling these features when usingJemalloc with ArangoDB. Please consult your operating system’s documentation forhow to do this.
Execute
before executing .
Linux only
It is recommended to assign swap space for a server that is running arangod.Configuring swap space can prevent the operating system’s OOM killer fromkilling ArangoDB too eagerly on Linux.
The recommended kernel setting for overcommit_memory
for both MMFiles andRocksDB storage engine is 0 or 1. The kernel default is 0.
You can set it as follows before executing arangod
:
When this flag is 0, the kernel attempts to estimate the amountof free memory left when userspace requests more memory.
When this flag is 2, the kernel uses a “never overcommit”policy that attempts to prevent any overcommit of memory.
Zone Reclaim
Execute
before executing arangod
.
From www.kernel.org:
This is value ORed together of
- 1 = Zone reclaim on
- 2 = Zone reclaim writes dirty pages out
- 4 = Zone reclaim swaps pages
NUMA
Multi-processor systems often have non-uniform Access Memory (NUMA). ArangoDBshould be started with interleave on such system. This can be achieved using
numactl --interleave=all arangod ...
Linux only
To avoid this scenario, it is recommended to raise the default value for themaximum number of memory mappings to a sufficiently high value. As a rule ofthumb, one could use 8 times the number of available cores times 8,000.
For a 32 core server, a good rule-of-thumb value thus would be 2,048,000 (32 8 8000). For certain workloads, it may be sensible to use even a highervalue for the number of memory mappings.
To set the value once, use the following command before starting arangod:
To make the settings durable, it will be necessary to store the adjusted settings in /etc/sysctl.conf or other places that the operating system islooking at.
Environment Variables
Linux only
It is recommended to set the environment variable to 1 onsystems that use glibc++ in order to disable the memory pooling built intoglibc++. That memory pooling is unnecessary because Jemalloc will already domemory pooling.
Execute
before starting arangod
.
While it is possible to compile ArangoDB on 32bit system, this is not arecommended environment. 64bit systems can address a significantly biggermemory region.