[MongoDB] Disable Transparent Huge Pages (THP)

BLOG

7/1/20241 min lire

Transparent Huge Pages (THP) is a Linux memory management system that reduces the overhead of Translation Lookaside Buffer (TLB) lookups on machines with large amounts of memory by using larger memory pages.

However, database workloads often perform poorly with THP enabled, because they tend to have sparse rather than contiguous memory access patterns. When running MongoDB on Linux, THP should be disabled for best performance.

> Ensure that THP is enabled

> Create a Service File

> Reload systemd unit files

> Start the service

> Configure your operating system to run it on boot

> Verify that THP has successfully been set to [never] by running the following command: