【基本情况】
我们可以使用telnet来连接memcached服务来查看memcached的状态等信息。
【telnet连接】
[quote]telnet host port
command[/quote]
[img]http://dl2.iteye.com/upload/attachment/0101/4986/9a9ef924-4bfa-30ea-a4ba-08801c5acbc6.jpg[/img]
【基本命令】
[img]http://dl2.iteye.com/upload/attachment/0101/4966/26ed9de0-9a12-325c-9687-012ddf515486.jpg[/img]
【简单例子】
存储命令格式
[quote]<command name> <key> <flags> <exptime> <bytes>
<data block>
参数说明如下:
<command name> set/add/replace
<key> 查找关键字
<flags> 客户机使用它存储关于键值对的额外信息
<exptime> 该数据的存活时间,0表示永远
<bytes> 存储字节数
<data block> 存储的数据块(可直接理解为key-value结构中的value)
[/quote]
set设置变量,get获得变量,delete删除变量
[img]http://dl2.iteye.com/upload/attachment/0101/4977/d29dfefa-c262-3eb1-80cd-ce23d4aade25.jpg[/img]
stats获得基本的统计,如命中成功,命中失败,连接数等
[img]http://dl2.iteye.com/upload/attachment/0101/4975/9c8cf74b-5e38-3fd9-bdb2-dd4bc59cfa5c.jpg[/img]
【参考】
[url]http://lzone.de/articles/memcached.htm[/url]
[url]http://www.cnblogs.com/jeffwongishandsome/archive/2011/11/06/2238265.html[/url]
我们可以使用telnet来连接memcached服务来查看memcached的状态等信息。
【telnet连接】
[quote]telnet host port
command[/quote]
[img]http://dl2.iteye.com/upload/attachment/0101/4986/9a9ef924-4bfa-30ea-a4ba-08801c5acbc6.jpg[/img]
【基本命令】
[img]http://dl2.iteye.com/upload/attachment/0101/4966/26ed9de0-9a12-325c-9687-012ddf515486.jpg[/img]
【简单例子】
存储命令格式
[quote]<command name> <key> <flags> <exptime> <bytes>
<data block>
参数说明如下:
<command name> set/add/replace
<key> 查找关键字
<flags> 客户机使用它存储关于键值对的额外信息
<exptime> 该数据的存活时间,0表示永远
<bytes> 存储字节数
<data block> 存储的数据块(可直接理解为key-value结构中的value)
[/quote]
set设置变量,get获得变量,delete删除变量
[img]http://dl2.iteye.com/upload/attachment/0101/4977/d29dfefa-c262-3eb1-80cd-ce23d4aade25.jpg[/img]
stats获得基本的统计,如命中成功,命中失败,连接数等
[img]http://dl2.iteye.com/upload/attachment/0101/4975/9c8cf74b-5e38-3fd9-bdb2-dd4bc59cfa5c.jpg[/img]
【参考】
[url]http://lzone.de/articles/memcached.htm[/url]
[url]http://www.cnblogs.com/jeffwongishandsome/archive/2011/11/06/2238265.html[/url]