Redis笔记 info命令

命令具体实现在redis-3.0/src/redis.c:genRedisInfoString

Memory

  • used_memory是redis通过在每次执行mallocfree等函数的时候维护定义在src/zmalloc.c中的used_memory变量实现的
  • used_memory_rss在linux中是通过读/proc/{pid}/stat这个文件的第24个字段rss实现的
  • used_memory_peakRecord the max memory used since the server was started.
  • mem_fragmentation_ratioFragmentation = RSS / allocated-bytes,allocated-bytes即为used_memory

CPU

  • used_cpu_user调用getrusage得到的ru_utime
  • used_cpu_sys调用getrusage得到的ru_stime

猜你喜欢

转载自www.cnblogs.com/ToRapture/p/12023274.html
今日推荐