- 使用nc来连接memcached:
nc 127.0.0.1 11211
stats
STAT pid 12116
STAT uptime 11407630
STAT time 1367896538
STAT version 1.2.6
STAT pointer_size 32
STAT rusage_user 85.714969
STAT rusage_system 234.852297
STAT curr_items 18394
STAT total_items 1605921
STAT bytes 20144115
STAT curr_connections 35
STAT total_connections 792502
STAT connection_structures 140
STAT cmd_get 5607557
STAT cmd_set 1605921
STAT get_hits 4874875
STAT get_misses 732682
STAT evictions 0
STAT bytes_read 2578556688
STAT bytes_written 11713360740
STAT limit_maxbytes 134217728
STAT threads 1
END
- 常用的管理命令如下:
Command | Description | Example |
get | Reads a value | get mykey |
set | Set a key unconditionally | set mykey 0 60 5 |
add | Add a new key | add newkey 0 60 5 |
replace | Overwrite existing key | replace key 0 60 5 |
append | Append data to existing key | append key 0 60 15 |
prepend | Prepend data to existing key | prepend key 0 60 15 |
incr | Increments numerical key value by given number | incr mykey 2 |
decr | Decrements numerical key value by given number | decr mykey 5 |
delete | Deletes an existing key | delete mykey |
flush_all | Invalidate specific items immediately | flush_all |
Invalidate all items in n seconds | flush_all 900 | |
stats | Prints general statistics | stats |
Prints memory statistics | stats slabs | |
Prints memory statistics | stats malloc | |
Print higher level allocation statistics | stats items | |
stats detail | ||
stats sizes | ||
Resets statistics | stats reset | |
version | Prints server version. | version |
verbosity | Increases log level | verbosity |
quit | Terminate telnet session | quit |