前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >redis安装好之后必做的几件事

redis安装好之后必做的几件事

作者头像
用户8851537
修改2021-07-22 10:08:23
3770
修改2021-07-22 10:08:23
举报
文章被收录于专栏:用户8851537的专栏

先来看一段日志

代码语言:javascript
复制
1525:M 21 Nov 11:10:36.412 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
22552:M 19 Jan 10:36:26.936 # Server started, Redis version 3.2.12
22552:M 19 Jan 10:36:26.936 # 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.
22552:M 19 Jan 10:36:26.936 # 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.
22552:M 19 Jan 10:36:26.936 * The server is now ready to accept connections on port 6380

解决办法:

代码语言:javascript
复制
$ echo never > /sys/kernel/mm/transparent_hugepage/enabled

$ vim /etc/rc.local  # 写入下面一行
echo never > /sys/kernel/mm/transparent_hugepage/enabled

$ vim /etc/sysctl.conf  # 写入下面2行
net.core.somaxconn = 1024
vm.overcommit_memory = 1

$ sysctl -p

本文系转载,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文系转载前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
云数据库 Redis
腾讯云数据库 Redis(TencentDB for Redis)是腾讯云打造的兼容 Redis 协议的缓存和存储服务。丰富的数据结构能帮助您完成不同类型的业务场景开发。支持主从热备,提供自动容灾切换、数据备份、故障迁移、实例监控、在线扩容、数据回档等全套的数据库服务。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档