memcached 命中率及状态说明

printf "stats\r\n" | nc 11211
STAT pid 2529
STAT uptime 1078133
STAT time 1241415864
STAT version 1.2.4
STAT pointer_size 64
STAT rusage_user 489.302614
STAT rusage_system 6850.564555
STAT curr_items 2537
STAT total_items 872539
STAT bytes 9939637
STAT curr_connections 17
STAT total_connections 6166911
STAT connection_structures 110
STAT cmd_get 68414905
STAT cmd_set 872539
STAT get_hits 67605437
STAT get_misses 809468
STAT evictions 0
STAT bytes_read 921056148171
STAT bytes_written 2323979209207
STAT limit_maxbytes 134217728
STAT threads 4

一、缓存命中率 = get_hits/cmd_get * 100%
三、total_items == cmd_set == get_misses,当可用最大内存用光时,memcached就会删掉一些内容,等式就会不成立

linux ps命令的状态说明


D Uninterruptible sleep (usually IO)
R Running or runnable (on run queue)
S Interruptible sleep (waiting for an event to complete)
T Stopped, either by a job control signal or because it is being traced.
W paging (not valid since the 2.6.xx kernel)
X dead (should never be seen)
Z Defunct (“zombie”) process, terminated but not reaped by its parent.
< high-priority (not nice to other users)
N low-priority (nice to other users)
L has pages locked into memory (for real-time and custom IO)
s is a session leader
l is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)
+ is in the foreground process group