memchache的操作

hash使用crc32循环校验冗余算法
如果两个不同终端操作同一个值
下载memchache
解压
进入cmd 切换进memchache目录
memchached.exe -d install
启动memchached
第一种进入服务点击启动
第二种命令行memchached.exe -d  start
memchached.exe -p 11211
使用 netstat -an看11211是否成功anb
netstat -anb哪个程序在监听还可以看到哪些连接到ip
tracert ip
注意事项
1以administrator
2目录没有中文
4如何crud操作
1php 2 telnet memchached扩展 memchache扩展 socket操作
增加
add key [压缩0|1] [超时] [字节]
add key1 0 30 5
hello
STORED
get key1  #获取
VALUE key1 0 5
hello
END
修改
set key [压缩0|1] [超时] [字节]
add key1 0 0 5
hello
STORED
set key1 0 40 5 key1不存在添加若存在相当于替换
hqweq
STORED
get key1
VALUE key1 0 5
hqweq
END

replace key
replace key1 0 40 5
aa
get key1
删除
基本语法
delete key
add key300  0 300 5
abcde
STORED
delete key300
DELETED
get key300
END
append key300  0 60 2
ad
prepend key300 0 60 1
a
incr key 1数字key
decr key 2数字
flush_all+时间 flush_all1900

set con 0 0 1
a
STORED
gets con
VALUE con 0 1 7版本号为7
a
END
get con
VALUE con 0 1
a
cas con 0 0 1 1 --以版本号来改保持一致性
a
EXISTS


stats

STAT pid 30378
STAT uptime 4812
STAT time 1451224535
STAT version 1.2.8
STAT pointer_size 64
STAT rusage_user 0.113982
STAT rusage_system 0.420936
STAT curr_items 1
STAT total_items 5
STAT bytes 74
STAT curr_connections 6
STAT total_connections 8
STAT connection_structures 7
STAT cmd_flush 0
STAT cmd_get 4
STAT cmd_set 13
STAT get_hits 3
STAT get_misses 1
STAT evictions 0
STAT bytes_read 856
STAT bytes_written 731
STAT limit_maxbytes 67108864
STAT threads 2
STAT accepting_conns 1
STAT listen_disabled_num 0
STAT replication MASTER
STAT repcached_version 2.2
STAT repcached_qi_free 8192
END民众率cmd_hi/cmd_gets

你可能感兴趣的:(memchache的操作)