在命令行下,查看memcached的状态的命令为:打印出如下内容:
STAT pid 8850
STAT uptime 15807716
STAT time 1328163326
STAT version 1.2.6
STAT pointer_size 64
STAT rusage_user 38033.922964
STAT rusage_system 142872.705047
STAT curr_items 33156
STAT total_items 862511669
STAT bytes 353908884
STAT curr_connections 2
STAT total_connections 1001793650
STAT connection_structures 820
STAT cmd_get 994366842
STAT cmd_set 862511669
STAT get_hits 801769724
STAT get_misses 192597118
STAT evictions 672425
STAT bytes_read 12305418028856
STAT bytes_written 11684752872727
STAT limit_maxbytes 402653184
STAT threads 1
END
而命中率是这样计算的
缓存命中率 = get_hits / cmd_get * 100%
上例中的命中率就为: 801769724/994366842*100%=80.6%
- echo stats |nc 127.0.0.1 11211
STAT pid 8850
STAT uptime 15807716
STAT time 1328163326
STAT version 1.2.6
STAT pointer_size 64
STAT rusage_user 38033.922964
STAT rusage_system 142872.705047
STAT curr_items 33156
STAT total_items 862511669
STAT bytes 353908884
STAT curr_connections 2
STAT total_connections 1001793650
STAT connection_structures 820
STAT cmd_get 994366842
STAT cmd_set 862511669
STAT get_hits 801769724
STAT get_misses 192597118
STAT evictions 672425
STAT bytes_read 12305418028856
STAT bytes_written 11684752872727
STAT limit_maxbytes 402653184
STAT threads 1
END
而命中率是这样计算的
缓存命中率 = get_hits / cmd_get * 100%
上例中的命中率就为: 801769724/994366842*100%=80.6%
编辑回复