当前位置:网站首页>Docker starts the general solution of three warnings of redis official image
Docker starts the general solution of three warnings of redis official image
2022-04-22 03:29:00 【devops_ sre】
Preface
… …
Warning message
As shown below :
# WARNING: The TCP backlog setting of 511 cannot be enforced because
/proc/sys/net/core/somaxconn is set to the lower value of 128
# 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.
terms of settlement
About TCP backlog Set up
- Prompt information
WARNING: The TCP backlog setting of 511 cannot be enforced because
/proc/sys/net/core/somaxconn is set to the lower value of 128
tcp The number of connections is set to 128 Too small
- Treatment measures ( The host performs the operation )
]# cat >> /etc/sysctl.conf <<-EOF
net.core.somaxconn=551 # The data here is adjusted according to the needs of production and the performance of the computer , Must be greater than or equal to 551
EOF
]# sysctl -p
About overcommit_memory Set up
- Prompt information
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.
overcommit_memory Is set to 0 when Under low memory conditions , Background save may fail
- Treatment measures ( The host performs the operation )
]# cat >> /etc/sysctl.conf <<-EOF
vm.overcommit_memory=1
EOF
]# sysctl -p
About THP Supported settings
- Prompt information
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.
Transparent large pages are enabled in the kernel (THP) Support . This will lead to Redis The latency and memory usage problems of
- Treatment measures ( The host performs the operation )
]# cat >> /etc/rc.local <<-EOF
echo never > /sys/kernel/mm/transparent_hugepage/enabled
EOF
]# chmod +x /etc/rc.local
]# source /etc/rc.local
restart redis service
]# /data/deploy/redis
]# docker-compose down
]# docker-compose up -d
]# docker exec redis cat /proc/sys/net/core/somaxconn
128
- If I found somaxconn The value of the or 128, Not into 551 when , The description does not take effect in the container , You need to execute the command in the container , New deployment redis Of docker-compose.yml The file is shown below
version: "3.5"
services:
redis:
image: redis:5.0.0
container_name: redis
hostname: redis
privileged: true
user: root
ports:
- 6379:6379
command: # Multiple commands are executed at the same time
- /bin/bash
- -c
- |
echo 551 > /proc/sys/net/core/somaxconn # Key orders
redis-server --requirepass na1234
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- /data/volume/redis:/data
restart: always
tty: true
Update deployment
]# docker-compose up -d
]# docker exec redis cat /proc/sys/net/core/somaxconn
551
Conclusion
… …
版权声明
本文为[devops_ sre]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220324455581.html
边栏推荐
- 2022年当选IEEE Fellow的人员列表
- Summarize the differences between queue: work and queue: listen
- 2500 words, hands take you to a preliminary understanding of static keywords, pointers and structures
- 吉他乐理整理
- Third season recruitment of cognitive computing neuroscience online reading club
- Full summary of 18 tax categories of tax law with memory tips
- Nacos access message 404
- Use and principle of atomic class
- 7-Zip exposes zero day security vulnerabilities! Provide administrator privileges to attackers by "impersonating file extensions"
- Multithreaded communication
猜你喜欢

Knowledge of power system

Manage laravel queue with supervisor - configuration file supervisor conf

C language constant, string, escape character, initial level of annotation

php.ini配置

Ink back words -- extract all its offline words through the installation package

Jupyter code cannot be run

Allegro Gerber file path setting

C language daily question -- xiaolele changing numbers (niuke.com)

Nacos access message 404

Bad config encountered during initialization:/ No such notebook dir:
随机推荐
MNIST recognition through back propagation
Use and principle of atomic class
Database management tools
JS 数字千位分隔符且保留两位小数
Deep learning and image recognition: principle and practice notes day_ seventeen
Comparison based on numerical differentiation and error back propagation
The basic software products of xinghuan science and technology have been fully implemented and blossomed, bringing "Star" momentum to the digital transformation of enterprises
ECMAScript 6 -- Deconstruction and assignment of variables
Deep learning and image recognition: principle and practice notes day_ thirteen
【C】猜数字,关机小程序,一些分支循环的练手题
Bad config encountered during initialization:/ No such notebook dir:
C language to achieve three chess
College English vocabulary analysis Chinese University MOOC Huazhong University of science and technology
Deep learning and image recognition: principle and practice notes day_ twelve
leetcode:297. 二叉树的序列化与反序列化
Let others connect to their own MySQL database and share the MySQL database
Zabbix5 series - making topology map (XIII)
JS digit thousands separator with two decimal places reserved
Chapter 9 introduction to kernel synchronization
js力扣每日一题(2022/4/21)---824.山羊拉丁文