memcached命令率=git_hits/curr_itemsphp
查看memcached状态
memcached-tool 服务端IP:服务端端口 stats
echo stats |nc 服务端IP 服务端端口
memstat --servers=服务端IP:服务端端口git
建立数据和查看数据
set key2 0 30 2
说明;30是过时时间(若是设置成0,表明永不过时);2是字符长度;0是flags的标记(通常是开发的定义来建立)github
set在没有对应的key时候就增长,有的就覆盖
add是增长key,存在的是失败web
导出和导入(由于memcached是把数据缓存在内存中,在重启服务或者是重启机器前作备份)
导出
memcached-tool 服务端IP:服务端端口 dump > xxx缓存
导入
nc 服务端IP 服务端端口 < xxxphp7
php的memcache模块
wget http://www.apelearn.com/bbs/data/attachment/forum/memcache-2.2.3.tgzide
php7的memcache模块
wget https://github.com/websupport-sk/pecl-memcache/archive/php7.zip
unzip pecl-memcache-php7.zip
cd pecl-memcache-php7
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --enable-memcache
make && make installmemcached