- 浏览: 154285 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
一凡蹈客:
really good
百万级访问网站前期的技术准备 -
lllt:
这种效果实际上不需要任何js的
加载图片时由模糊变清楚原理---类似QQ空间的相册的效果 -
JavaStudyEye:
如何在三个月内获得三年的工作经验------实际的很 -
JavaStudyEye:
...
如何在三个月内获得三年的工作经验------实际的很 -
filish108:
如何在三个月内获得三年的工作经验------实际的很
memcached Telnet Interface
This is a short summary of everything important that helps to inspect a running memcached instance. How To Connect Use "ps -ef" to find out which IP and port was passed when memcached was started and use the same with telnet to connect to memcache. Example: telnet 10.10.1.24 23456
Supported Commands The supported commands (the official ones and some unofficial) are documented in the doc/protocol.txt document. Sadly the syntax description isn't really clear and a simple help command listing the existing commands would be much better. Here is an overview of the commands you can find in the source (as of 16.12.2008):
Traffic Statistics You can query the current traffic statistics using the command statsYou will get a listing which serves the number of connections, bytes in/out and much more.
Example Output: STAT pid 14868 STAT uptime 175931 STAT time 1220540125 STAT version 1.2.2 STAT pointer_size 32 STAT rusage_user 620.299700 STAT rusage_system 1545.703017 STAT curr_items 228 STAT total_items 779 STAT bytes 15525 STAT curr_connections 92 STAT total_connections 1740 STAT connection_structures 165 STAT cmd_get 7411 STAT cmd_set 28445156 STAT get_hits 5183 STAT get_misses 2228 STAT evictions 0 STAT bytes_read 2112768087 STAT bytes_written 1000038245 STAT limit_maxbytes 52428800 STAT threads 1 END
Memory Statistics You can query the current memory statistics using stats slabs
Example Output: STAT 1:chunk_size 80 STAT 1:chunks_per_page 13107 STAT 1:total_pages 1 STAT 1:total_chunks 13107 STAT 1:used_chunks 13106 STAT 1:free_chunks 1 STAT 1:free_chunks_end 12886 STAT 2:chunk_size 100 STAT 2:chunks_per_page 10485 STAT 2:total_pages 1 STAT 2:total_chunks 10485 STAT 2:used_chunks 10484 STAT 2:free_chunks 1 STAT 2:free_chunks_end 10477 [...] STAT active_slabs 3 STAT total_malloced 3145436 END
Which Keys Are Used? There seems to be no builtin function to determine the currently set keys. However you can use the stats itemscommand to determine how many keys do exist. stats items STAT items:1:number 220 STAT items:1:age 83095 STAT items:2:number 7 STAT items:2:age 1405 [...] ENDThis at least helps to see if any keys are used. To dump the key names from a PHP script that already does the memcache access you can use the PHP code from100days.de.
Never Set a Timeout > 30 Days! While this has nothing to do with the telnet access this is a problem you might run into. If you try to "set" or "add" a key with a timeout bigger than the allowed maximum you might not get what you expect because memcached then treats the value as a Unix timestamp. Also if the timestamp is in the past it will do nothing at all. Your command will silently fail. So if you want to use the maximum lifetime specify 2592000. Example: set my_key 0 2592000 1 1 Disappearing Keys on Overflow Despite the documentation saying something about wrapping around 64bit overflowing a value using "incr" causes the value to disappear. It needs to be created using "add"/"set" again.
|
memcached telnet相关操作
elnet localhost 11211
//保存
set good 32 0 10
helloworld
STORED
//取回
gets good
VALUE good 32 10 10
helloworld
END
//替换
replace good 32 0 10
worldhello
STORED
get good
VALUE good 32 10
worldhello
END
//尾部添加
append good 32 0 5
after
STORED
get good
VALUE good 32 15
worldhelloafter
END
//头部添加
prepend good 32 0 6
before
STORED
get good
VALUE good 32 21
beforeworldhelloafter
END
//删除
delete good
DELETED
get good
END
delete good
NOT_FOUND
cas good 32 0 10 hel
helloworld
EXISTS
gets good
VALUE good 32 10 10
helloworld
END
cas bad 32 0 10 good
worldhello
NOT_FOUND
//统计
stats items
STAT items:1:number 1
STAT items:1:age 24
STAT items:1:evicted 0
STAT items:1:outofmemory 0
END
stats sizes
96 1
END
stats slabs
STAT 1:chunk_size 88
STAT 1:chunks_per_page 11915
STAT 1:total_pages 1
STAT 1:total_chunks 11915
STAT 1:used_chunks 11914
STAT 1:free_chunks 1
STAT 1:free_chunks_end 11913
STAT 2:chunk_size 112
STAT 2:chunks_per_page 9362
STAT 2:total_pages 1
STAT 2:total_chunks 9362
STAT 2:used_chunks 9361
STAT 2:free_chunks 1
STAT 2:free_chunks_end 9361
STAT 5:chunk_size 232
STAT 5:chunks_per_page 4519
STAT 5:total_pages 1
STAT 5:total_chunks 4519
STAT 5:used_chunks 4518
STAT 5:free_chunks 1
STAT 5:free_chunks_end 4518
STAT active_slabs 3
STAT total_malloced 3145472
END
stats items
STAT items:1:number 1
STAT items:1:age 1768
STAT items:1:evicted 0
STAT items:1:outofmemory 0
END
stats
STAT pid 18261
STAT uptime 528593
STAT time 1237277383
STAT version 1.2.6
STAT pointer_size 32
STAT rusage_user 0.004999
STAT rusage_system 0.015997
STAT curr_items 1
STAT total_items 2
STAT bytes 66
STAT curr_connections 2
STAT total_connections 13
STAT connection_structures 3
STAT cmd_get 11
STAT cmd_set 8
STAT get_hits 2
STAT get_misses 9
STAT evictions 0
STAT bytes_read 1342
STAT bytes_written 8752
STAT limit_maxbytes 134217728
STAT threads 1
END
使用usr/bin/perl /root/memcached-1.2.6/scripts/memcached-tool localhost:11211
output
# Item_Size Max_age 1MB_pages Count Full?
1 88 B 1531 s 1 1 no
2 112 B 0 s 1 0 no
5 232 B 0 s 1 0 no
# slab class编号
Item_Size Chunk大小
Max_age LRU内最旧的记录的生存时间
1MB_pages 分配给Slab的页数
Count Slab内的记录数
Full? Slab内是否含有空闲chunk
发表评论
-
Linux系统中memcache和memcached安装方法
2011-08-23 02:29 995Memcache 是一 ... -
apache不解析php文档?提示需要下载
2011-08-22 06:25 1192作者:陆文举 http://blog.luwenju.c ... -
Linux上全源码安装Apache、MySQL、PH
2011-08-21 20:11 1165Linux上全源码安装Apache、MySQL、PHP、W ... -
安装PHP常见错误解决error
2011-08-21 19:48 1245PHP的安装虽然有时候很简单,可是如果应用一多,我们安装起 ... -
php需要学的真多,一个php牛人的需要的经历
2011-02-11 18:12 1348php需要学的真多。因为触级的太多。一个php牛人的需要的 ... -
Firebug基本知识推广
2010-11-25 19:33 632... -
通过Filter实现二级域名和URLRewrite
2010-11-24 20:45 855通过Filter实现二级域名和URLRewrite 文章分类 ... -
将 WordPress 文章同步发送到 Twitter,新浪微博,搜狐微博,QQ微博,嘀咕,开心,人人
2010-11-21 00:54 3357这两天没事,Forece 又开始折腾了,想把自己用 Word ... -
Smarty foreach详解
2010-11-11 09:44 1042Smar ... -
30分钟速通,PHP模板引擎Smarty
2010-11-09 20:10 158130分钟速通,PHP模板引擎Smarty 分类: ... -
PHP5面向对象学习教程(7月十五写的)
2010-10-14 07:31 722PHP5面向对象教程.CHM (41.83 KB) 下 ... -
PHP中 __FILE__ 和 dirname(__FILE__) 使用
2010-10-14 06:58 1202__FILE__ 返回网站根目录 ... -
建立host 文件桌面快捷方式
2010-09-27 19:10 1188A) 关于建立 host 文件记事本打开的快捷方式: ... -
Apache httpd.conf详解
2010-09-25 13:57 1085Apache服务器的设置文件 ... -
smarty整理总结
2010-09-13 18:19 7481.smarty的配置 首先,使用smarty第 ... -
从源码安装apache2,遇到错误:cannot install `libaprutil-1.la' LAMP 2010-07-23 20:57:15 阅读3
2010-09-08 10:59 884从源码安装apache2,遇到错误:cannot ins ... -
Tortoise SVN 客户端 基本用法
2010-09-07 20:07 907Tortoise SVN 客户端 基 ... -
phpMyAdmin安装配置方法全过程,及问题解决
2010-01-28 10:24 1168今天调试PHP数据库Mysql ... -
找出占用你端口的罪魁祸首
2010-01-03 14:52 907做开发的同学经常会碰到一个恼人的问题,那就是启动服务器时会抛出 ... -
PHP常见面试题目深入解答分析
2009-12-28 23:39 1283很久没有更新了,继续上一篇文.再来讨论几道常见的试题.查看 ...
相关推荐
memcache的配置及使用——memcache及其客户端telnet
Memcache安装配置使用说明 亲测可用
压缩包中包含最新版Win32 Memcache服务器端和安装及测试文档
2.在终端(也即cmd命令界面)下输入'c:\memcached\memcached.exe -d install'安装 3.再输入:'c:\memcached\memcached.exe -d start'启动。NOTE:以后memcached将作为windows的一个服务每次开机时自动启动。这样...
Memcache是一个高性能的...使用Memcache的网站一般流量都是比较大的,为了缓解数据库的压力,让Memcache作为一个缓存区域,把部分信息保存在内存中,在前端能够迅速的进行存取。那么一般的焦点就是集中在如何分担数据
windows下使用memcache方法 含软件 其中包含在PHP下使用方法
内附高老师的memcache安装说明 本人的使用示例和memcache windows下的安装包、PHP扩展包及linux的源码包 缓存技术是数据库的救星 希望大家多多交流
Windows下的Memcache安装: 1. 下载memcache的windows稳定版,解压放某个盘下面,比如在c:\memcached 2. 在终端(也即cmd命令界面,...6.重新启动Apache,然后查看一下phpinfo,如果有memcache,那么就说明安装成功!
主要讲述memcache分布式缓存的的配置使用
memcache_php使用测试
主要介绍了在telnet下操作memcache详解,telnet下的memcache操作命令详解,需要的朋友可以参考下
Memcache缓存技术 安装 使用 教程 步骤的讲解
Windows下的Memcache使用
windows下memcache安装包 附带php扩展包
Memcache缓存技术,Memcache配置说明及其文件,PHP5.2.6版本内存缓存技术配置,PHP运行环境PHP5.2.6版本的配置,操作系统是windows下
memcache图形监控工具phpmemcache,尽是一个PHP文件就可以...使用方法:本地测试监控机安装Apache或者下载XAMPP(Apache+MySQL+PHP+PERL),安装后把memcachephp.zip中的memcache.php文件放到www或者htdocs目录下即可。
windwos下安装memcache步骤以及安装包
spring与memcache的开发配置!很详细
memcache的配置及使用——C#引用文件
PHP 5.4 使用的 memcache 包含 memcache 服务端 和 php_memcache.dll