何时为 redis 关闭透明大页面 [英] When to turn off Transparent Huge Pages for redis

查看:42
本文介绍了何时为 redis 关闭透明大页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据 redis docs,建议禁用透明大页面.

According to redis docs, it's advisable to disable Transparent Huge Pages.

如果机器在 redis 服务器和应用程序之间共享,那么指导是否相同.

Would the guidance be the same if the machine was shared between the redis server and the application.

此外,对于其他技术,我还阅读了指南 在设置服务器时,应为所有生产环境禁用 THP.这种先发制人是否也适用于redis,还是必须先严格监控延迟问题,然后再决定关闭THP?

Moreover, for other technologies, I've also read guidance that THP should be disabled for all production environments when setting up the server. Is this kind of pre-emptiveness applicable to redis as well, or one must first strictly monitor latency issues before deciding to turn off THP?

推荐答案

将其关闭.问题在于 THP 如何移动内存以尝试保留或创建连续页面.一些应用程序可以容忍这一点,大多数数据库不能容忍,这会导致间歇性的性能问题,有些非常糟糕.无论如何,这不是 Redis 独有的.

Turn it off. The problem lies in how THP shifts memory around to try and keep or create contiguous pages. Some applications can tolerate this, most databases cannot and it causes intermittent performance problems, some pretty bad. This is not unique to Redis by any means.

对于您的应用程序,尤其是 JAVA 应用程序,请设置真正的 HugePages,并且将透明的多样性排除在外.如果您这样做,请确保为应用程序和 redis 正确分配内存.尽管我不得不说,我可能不建议在同一个实例/服务器/虚拟机上同时运行应用程序和 redis.

For your application, especially if it is JAVA, set up real HugePages and leave the transparent variety out of it. If you do that just make sure you alocate memory correctly for the app and redis. Though I have to say, I probably would not recommend running both the app and redis on the same instance/server/vm.

这篇关于何时为 redis 关闭透明大页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆