Redis 服务器

INFO、CONFIG、慢日志等运维命令。

Beginner
Key PointsINFO 看全局指标,SLOWLOG 抓慢命令,CONFIG 调运行时参数。

INFO 与慢日志

Shell
INFO server             # 版本、模式、运行时间
INFO memory             # 内存使用
INFO clients            # 连接数
SLOWLOG GET 10          # 最近 10 条慢命令
SLOWLOG LEN
Output
# Memory
used_memory_human:2.31M
# Clients
connected_clients:3

运行时参数

Shell
CONFIG GET maxmemory
CONFIG SET maxmemory 1gb
CONFIG GET slowlog-max-len
Watch used_memory vs maxmemory; raise memory or tune eviction before hitting the cap. SLOWLOG is how you find what's stalling Redis — KEYS * or huge HGETALL show up here.

Friends & Partners