惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
U
Unit 42
Google DeepMind News
Google DeepMind News
博客园 - 司徒正美
Y
Y Combinator Blog
F
Fortinet All Blogs
云风的 BLOG
云风的 BLOG
T
Tailwind CSS Blog
G
Google Developers Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
罗磊的独立博客
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
MyScale Blog
MyScale Blog
N
Netflix TechBlog - Medium
Microsoft Security Blog
Microsoft Security Blog
GbyAI
GbyAI
P
Proofpoint News Feed
Jina AI
Jina AI
B
Blog RSS Feed
腾讯CDC
阮一峰的网络日志
阮一峰的网络日志
D
Docker

博客园 - cnkker.com

Visual Studio 2026 激活码 / VS2026密钥(VS2026激活码) 沙箱环境安装dotnet Microsoft Office 2024 全家桶 UFW防火墙规则对Docker映射端口无效 Nginx错误 open() "/usr/local/nginx/proxy_temp/x/xx/xxxxxxxx" failed (13: Permission denied) while reading upstream解决办法 NET8在CentOS7下无法执行的问题 Nginx配置文件中,如何配置启用SignalR Error: Failed to download metadata for repo ‘appstream’ – CentOS 8 Mikrotik ROS默认推荐防火墙规则firewall脚本 dotnet堆栈溢出通用排查方法 CMD下查所有3389连接的IP地址 Nginx的proxy_pass url 反向代理的配置 一些名词 NET CORE LINUX 部署 报 A connection was successfully established with the server, but then an error occurred during the pre-login handshake.解决方法 须先停止生成方可关闭解决方案(The build must be stopped before the solution can be closed) 安装最新版本NextCloud Docker、Nginx、整合LetsEncrypt SSL证书 如何将 Windows 10 Enterprise LTSC 2021 评估版升级到完整版 MS SQL 去除字段中的大小写英文、数字、特定符号 MariaDB 配置示例文件 整理一些激活密钥
docker-compose 部署 Redis 的一些警告
cnkker.com · 2024-12-03 · via 博客园 - cnkker.com

背景

内核参数 overcommit_memory警告

# WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. 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,它是内存分配的策略,可选值有:0、1、2。

0,表示内核将检查是否有足够的可用内存供应用进程使用;如果有足够的可用内存,内存申请允许;否则,内存申请失败,并把错误返回给应用进程。
1,表示内核允许分配所有的物理内存,而不管当前的内存状态如何。
2,表示内核允许分配超过所有物理内存和交换空间总和的内存。

第一步:
修改配置文件 vim /etc/sysctl.conf, 写入下面内容(注意是宿主机)

...
vm.overcommit_memory = 1

第二步:
使配置生效:

TCP 连接数异常

WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.

解决办法:

需要修改docker-compose.yml,添加:

sysctls:
    - net.core.somaxconn=65535

重启容器。