leg*_*gel 7 ubuntu amazon-ec2 redis sysctl huge-pages
在新的Ubuntu 16.04 EC2实例上,警告如下所示:
WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
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.
Run Code Online (Sandbox Code Playgroud)
如何永久消除它们?
如警告所示,只需将行添加vm.overcommit_memory=1
到的底部即可/etc/sysctl.conf
,例如sudo vi /etc/sysctl.conf
。
但是,权限不允许您按照警告的提示来编辑THP,而是这样做
sudo apt install hugepages
Run Code Online (Sandbox Code Playgroud)
并将命令添加sudo hugeadm --thp-never
到.bashrc的底部,类似sudo vi ~/.bashrc
。
然后sudo reboot
,下一次您运行SSH时redis-server
,警告消失了!
归档时间: |
|
查看次数: |
7537 次 |
最近记录: |