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

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
H
Hacker News: Front Page
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
aimingoo的专栏
aimingoo的专栏
Martin Fowler
Martin Fowler
博客园 - 叶小钗
Last Week in AI
Last Week in AI
Recent Announcements
Recent Announcements
P
Palo Alto Networks Blog
Webroot Blog
Webroot Blog
Hacker News: Ask HN
Hacker News: Ask HN
IT之家
IT之家
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
T
Threat Research - Cisco Blogs
C
CERT Recently Published Vulnerability Notes
Google DeepMind News
Google DeepMind News
Hugging Face - Blog
Hugging Face - Blog
H
Help Net Security
P
Privacy & Cybersecurity Law Blog
C
Cisco Blogs
罗磊的独立博客
The GitHub Blog
The GitHub Blog
M
MIT News - Artificial intelligence
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
Y
Y Combinator Blog
AWS News Blog
AWS News Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
K
Kaspersky official blog
博客园 - 司徒正美
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Security Archives - TechRepublic
Security Archives - TechRepublic
The Last Watchdog
The Last Watchdog
Jina AI
Jina AI
MyScale Blog
MyScale Blog
TaoSecurity Blog
TaoSecurity Blog
大猫的无限游戏
大猫的无限游戏
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Cisco Talos Blog
Cisco Talos Blog
美团技术团队
T
Tor Project blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
博客园 - 【当耐特】
博客园 - 聂微东
V2EX - 技术
V2EX - 技术
I
Intezer
V
Visual Studio Blog
酷 壳 – CoolShell
酷 壳 – CoolShell

博客园 - Tinywan

响应错误: Indirect modification of overloaded element of app\model\StudentCacheModel has no effect - Tinywan Ubuntu 22.04 编译安装 PHP 7.4.33 报错:make: *** [Makefile:749: ext/openssl/openssl.lo] Error 1 how to set mpdf HTML contains invalid UTF-8 character(s) 和 CPU 100% Nginx添加第三方模块,出现“is not binary compatible in”错误的解决方案 Docker 数据库连接见解异常 SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again 解决mysql死锁问题 SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction Java系列 | 如何讲自己的JAR包上传至阿里云maven私有仓库【云效制品仓库】 Redis系列 | 分类树查询功能如何从2s优化到0.1s Docker系列 | docker endpoint for “default” not found Node系列 | Node版本管理工具 fnm Java系列 | IntelliJ IDEA 如何导入和使用一个Jar包 Chrome扩展插件:Console Importer(控制台导入器) PHP系列 | mPdf字体库异常 Cannot find TTF TrueType font file "Eeyek.ttf" in configured font directories PHP系列 | PHP中的stdClass是什么? 网络安全 | 记录一次acme.sh更新证书 Error add txt for domain:_acme-challenge.tinywan.com 大数据系列 | 阿里云datav数据可视化(使用json文件生成可视化动态图标) Docker系列 | SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again768 Java系列 | Linux系统中运行JMeter脚本 PHP系列 | TP6使用表达式设置数据 Db::raw('end_time')
Redis Docekr WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition
Tinywan · 2024-03-01 · via 博客园 - Tinywan

Docker 容器

ssr-redis    | 1:C 01 Mar 2024 22:00:46.869 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
ssr-redis    | 1:C 01 Mar 2024 22:00:46.869 # Redis version=7.0.10, bits=64, commit=00000000, modified=0, pid=1, just started
ssr-redis    | 1:C 01 Mar 2024 22:00:46.869 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
ssr-redis    | 1:M 01 Mar 2024 22:00:46.869 * monotonic clock: POSIX clock_gettime
ssr-redis    | 1:M 01 Mar 2024 22:00:46.870 * Running mode=standalone, port=6379.
ssr-redis    | 1:M 01 Mar 2024 22:00:46.870 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
ssr-redis    | 1:M 01 Mar 2024 22:00:46.870 # Server initialized
ssr-redis    | 1:M 01 Mar 2024 22:00:46.870 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can 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.

您的 Redis 容器日志中的警告信息指出了内存超分配(overcommit)的设置问题。在 Linux 系统中,内存超分配是一种内核行为,允许进程分配超出物理内存大小的虚拟内存。对于 Redis,这是一个重要的设置,尤其是当执行如 RDB 快照或 AOF 日志重写等内存密集型操作时。

警告信息的含义

  • Redis 需要内存超分配(vm.overcommit_memory)被设置为 1。这意味着操作系统将始终允许分配所有请求的内存,这对于 Redis 的某些操作至关重要。
  • 如果没有正确设置,当 Redis 尝试创建快照或进行某些类型的复制时,可能会因为内存不足而失败。这可能导致数据丢失或其他问题。

解决方法

您需要在宿主机(运行 Docker 的服务器)上设置 vm.overcommit_memory 参数。这通常涉及两个步骤:

临时更改

在宿主机上执行以下命令:

sudo sysctl vm.overcommit_memory=1

永久更改

编辑 /etc/sysctl.conf 文件(或在某些系统上,可能是 /etc/sysctl.d/ 目录下的文件)。添加或修改以下行:

保存文件并重新启动系统,或者运行 sudo sysctl -p 来立即应用更改。

再次重启,问题解决