redis-cli CONFIG SET maxmemory4294967296redis-cli CONFIG SET maxmemory-policy allkeys-lru redis-cli CONFIG GET maxmemory redis-cli CONFIG GET maxmemory-policy redis-cli INFO memory
命令行编辑示例(Linux):
sudovi/etc/redis/redis.conf# 修改 maxmemory 与 maxmemory-policy 后保存退出sudosystemctl restart redis-server 或sudoserviceredis-server restart redis-cli CONFIG GET maxmemory redis-cli CONFIG GET maxmemory-policy
命令行编辑示例(Windows):
notepad C:\redis\redis.conf# 保存后重启进程Stop-Process-Name redis-server-ForceStart-Process"C:\redis\redis-server.exe"-ArgumentList"C:\redis\redis.conf"redis-cliCONFIG GET maxmemory redis-cliCONFIG GET maxmemory-policy
🐢 慢查询与阈值
slowlog-log-slower-than 10000 slowlog-max-len 256
通俗说明
超过阈值的命令会被记录到慢查询日志,便于定位性能问题。
保留一定长度的慢日志,结合采样与统计分析热点命令。
详细解释
slowlog-log-slower-than以微秒为单位;设得过低会产生大量记录。
配合slowlog-max-len控制日志长度,定期导出分析。
慢日志结合业务监控,定位大 Key、长阻塞与高延迟来源。
配置文件修改步骤(慢查询)
文件位置与修改方式同上;写入以下配置并重启生效:
slowlog-log-slower-than 10000 slowlog-max-len 256
运行时命令:
redis-cli CONFIG SET slowlog-log-slower-than10000redis-cli CONFIG SET slowlog-max-len256redis-cli CONFIG GET slowlog-log-slower-than redis-cli CONFIG GET slowlog-max-len
JoltPhysics球体碰撞边缘优化:从理论到工程实践 【免费下载链接】JoltPhysics A multi core friendly rigid body physics and collision detection library, written in C, suitable for games and VR applications. 项目地址: https://gitcode.com/GitHub_Trend…