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
Typst列表符号终极指南:从异常诊断到完美渲染 【免费下载链接】typst A new markup-based typesetting system that is powerful and easy to learn. 项目地址: https://gitcode.com/GitHub_Trending/ty/typst
在使用Typst进行文档排版时,列表符号…
远程管理效能革命:Quasar网络传输架构的深度优化策略 【免费下载链接】Quasar Remote Administration Tool for Windows 项目地址: https://gitcode.com/gh_mirrors/qua/Quasar
在日益复杂的网络环境中,远程管理工具的性能表现直接决定了运维效率…