简体   繁体   中英

Why THP (Transparent Huge Pages) are not recommended for Databases like Oracle and MongoDB?

I'm curious to know the reason why transparent huge pages are not recommended for the Databases like Oracle and MongoDB? How THP affect the performance of any Database?

Apparently it's because THP are swappable, and the Linux swap subsystem can only handle base page sizes and not HugePages. This creates a race condition which has a significant impact on system performance.

This Oracle blog dates from 2014 but still seems to be the final word on the topic.

Modern machines have not only enable or disable , there is also an madvise setting. All machines that I checked have the latter as default already(!) for the enable and defrag setting. Check

cat /sys/kernel/mm/transparent_hugepage/{enabled,defrag}

According to the definition of madvise, this disables THP by default, but allows applications to ask for THP support via an madvise() call.

Maybe the suggestions from 2014 are no longer relevant?

https://www.percona.com/blog/2019/03/06/settling-the-myth-of-transparent-hugepages-for-databases/ has a newer discussion on this topic.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM