docker – 禁用Kubernetes的透明大页面

weixin_38050892 2019-09-12 11:58:34
我通过Kubernetes部署Redis容器并收到以下警告: WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command ‘echo never > /sys/kernel/mm/transparent_hugepage/enabled’ as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled 是否可以通过Kubernetes禁用THP?也许通过init-containers?
...全文
172 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
weixin_38066019 2019-09-12
  • 打赏
  • 举报
回复
是的,使用init-containers,它非常简单: apiVersion: v1 kind: Pod metadata: name: thp-test spec: restartPolicy: Never terminationGracePeriodSeconds: 1 volumes: - name: host-sys hostPath: path: /sys initContainers: - name: disable-thp image: busybox volumeMounts: - name: host-sys mountPath: /host-sys command: ["sh", "-c", "echo never >/host-sys/kernel/mm/transparent_hugepage/enabled"] containers: - name: busybox image: busybox command: ["cat", "/sys/kernel/mm/transparent_hugepage/enabled"] Demo (notice that this is a system wide setting): 06001

473

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧