We have a bunch of general purpose Centos 7 LAMP stack servers that run apache with underlying MariaDB databases.
From the RedHat Performance Tuning docs for RHEL 6:
Trasparent Hugepages (THP) hides much of the complexity in using huge pages from system administrators and developers. As the goal of THP is improving performance, its developers (both from the community and Red Hat) have tested and optimized THP across a wide range of systems, configurations, applications, and workloads. This allows the default settings of THP to improve the performance of most system configurations. However, THP is not recommended for database workloads.
Which sounds great, up until the database section. In fact, some of the MariaDB options such as the TokuDB engine actually require THP to be disabled.
A lot of the guides I found for disabling THP instruct changing the default configuration from transparent_hugepages= always
to never
.
However, from the RedHat Performance Tuning docs for RHEL 7:
To prevent applications from allocating more memory resources than necessary, you can disable huge pages system-wide and only enable them inside MADV_HUGEPAGE madvise regions
If I have read this right, transparent_hugepages= madvise
seems like a much better option, allowing processes that benefit from THP to use them and those that don't to not.
I did find one article suggesting this approach.
Why is this not the default option?
Are there any situations where using transparent_hugepages= never
is wiser than madvise
?