The Memcached Stats command is useful for viewing the memcache running state.
Telnet to the memcached server after a lot of commands can be used, in addition to the well-known add, get, set, INCR, DECR, replace, delete and other assignment commands, there are a series of commands to obtain server information, This part of the command starts with stats.
Common commands:
Stats
Display server information, statistics, etc.
Stats Reset
Clear statistics
stats cachedump slab_id limit_num
Displays a list of the first limit_num keys in a slab, shown in the following format
ITEM Key_name [Value_length b; expire_time|access_time s], where memcached 1.2.2 and previous versions show the access Time (timestamp), 1.2.4 or later, Include 1.2.4 Display expiration Time (timestamp), if it is never expired key,expire_time will be displayed as server startup time
Stats Cachedump 7 2
ITEM Copy_test1 [+ b; 1207795754 S]
ITEM Copy_test [248 b; 1207793649 S]
Note: Do not attempt to export all key lists of a slab in the Memcache service through this command, which returns only 1M of memory data by default.
Stats Slabs
Displays information about each slab, including the size, number, usage, etc. of the chunk
Stats items
Displays the number of item in each slab and the age of the oldest item (the number of seconds the last access distance is now)
Stats detail [On|off|dump]
Set or display detailed operation Records
parameter is on to open detailed operation record
parameter is off, close verbose operation record
The parameter is dump, showing the detailed operation record (number of times each key value get, set, hit, Del)
Stats Detail Dump
PREFIX Copy_test2 get 1 hit 1 set 0 del 0
PREFIX Copy_test1 get 1 hit 1 set 0 del 0
PREFIX cpy get 1 hit 0 set 0 del 0