您能告诉我真实的应用程序示例,这些示例显示了 Linux 的透明大页 (THP) 导致的性能下降吗? 一些主页显示数据库应用程序(Hadoop、mongoDB、redis 等)显示性能下降,但我无法确认结果。
我想评估使用 THP 或不使用 THP 时的性能。 谢谢。
最佳答案
对于 Redis,性能下降已得到充分记录和测试,建议从 Redis 的 TFM 禁用大页面:
Unfortunately when a Linux kernel has transparent huge pages enabled, Redis incurs to a big latency penalty after the fork call is used in order to persist on disk. Huge pages are the cause of the following issue: Fork is called, two processes with shared huge pages are created. In a busy instance, a few event loops runs will cause commands to target a few thousand of pages, causing the copy on write of almost the whole process memory. This will result in big latency and big memory usage.
参见:
关于mongodb - Linux透明大页(THP)性能评估,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35102580/