stats STAT pid 1714 STAT uptime 10968984 STAT time 1492135105 STAT version 1.4.20 STAT libevent 1.4.13-stable STAT pointer_size 64 STAT rusage_user 20492.536660 STAT rusage_system 81749.473191 STAT curr_connections 730 STAT total_connections 46729 STAT connection_structures 1089 STAT reserved_fds 20 STAT cmd_get 3402017 STAT cmd_set 1505778 STAT cmd_flush 0 STAT cmd_touch 0 STAT get_hits 2232089 STAT get_misses 1169928 STAT delete_misses 43014 STAT delete_hits 3157 STAT incr_misses 10 STAT incr_hits 338 STAT decr_misses 0 STAT decr_hits 0 STAT cas_misses 0 STAT cas_hits 0 STAT cas_badval 0 STAT touch_hits 0 STAT touch_misses 0 STAT auth_cmds 0 STAT auth_errors 0 STAT bytes_read 17514478992 STAT bytes_written 29164195180 STAT limit_maxbytes 1073741824 STAT accepting_conns 1 STAT listen_disabled_num 0 STAT threads 4 STAT conn_yields 5 STAT hash_power_level 16 STAT hash_bytes 524288 STAT hash_is_expanding 0 STAT malloc_fails 0 STAT bytes 1464285 STAT curr_items 5921 STAT total_items 1505767 STAT expired_unfetched 19880 STAT evicted_unfetched 0 STAT evictions 0 STAT reclaimed 48130 STAT crawler_reclaimed 0 END
2. 基本操作
(1) get 操作
1 2
get key gets key1 key2 key3 ...
(2) set 操作
1 2
set key flags exptime bytes [noreply] value
参数说明如下:
key:键值 key-value 结构中的 key,用于查找缓存值。
flags:可以包括键值对的整型参数,客户机使用它存储关于键值对的额外信息 。
exptime:在缓存中保存键值对的时间长度(以秒为单位,0 表示永远)
bytes:在缓存中存储的字节数
noreply(可选): 该参数告知服务器不需要返回数据
value:存储的值(始终位于第二行)(可直接理解为key-value结构中的value)
示例:
1 2 3 4 5 6 7 8 9 10 11 12 13
set wvrunoob 0 90 9 memcached STORED
set d2p_user_token_wv_A14697271492505300250 0 90 108 eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJBMTQ2OTcyNywxNDkyNTA1MzAwMjUwIn0.Ch0cNcGeodKSiZONFhdEByJe4eeNgaUzdQkm037Petk STORED