查看Memcache运行情况

Memcache
Memcache是danga.com的一个开源项目,它是一个高性能的分布式的内存对象缓存系统,经过在内存里维护一个统一的巨大的Hash表,可以用来存储各类格式的数据。

查看当前的memcache链接数:

[root@mem1 ~]# netstat -n | grep :11211 | wc -l
15752

查看默认容许的链接数:
[root@mem1 ~]# cat /etc/rc.local 
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
/usr/local/bin/memcached -d -m 15360 -u root -l 172.20.1.54 -p 11211 -c 40960  
/usr/local/bin/memcached -d -m 512 -u root -l 172.20.1.54 -p 11212 -c 10000 


这里设置的11211端口默认链接数是40960
缓存

 

在网络上查到资料, Memcache也有本身的查看工具:服务器

如何查看memcache服务器端版本:  ./memcached  -h网络

memcache的运行状态能够方便的用 stats 命令显示。
首先用telnet 127.0.0.1 11211这样的命令链接上memcache,而后直接输入stats就能够获得当前memcache的状态。
这些状态的说明以下:
分布式

pid memcache服务器的进程ID
uptime 服务器已经运行的秒数
time 服务器当前的unix时间戳
version memcache版本
pointer_size 当前操做系统的指针大小(32位系统通常是32bit)
rusage_user 进程的累计用户时间
rusage_system 进程的累计系统时间
curr_items 服务器当前存储的items数量
total_items 从服务器启动之后存储的items总数量
bytes 当前服务器存储items占用的字节数
curr_connections 当前打开着的链接数
total_connections 从服务器启动之后曾经打开过的链接数
connection_structures 服务器分配的链接构造数
cmd_get get命令(获取)总请求次数
cmd_set set命令(保存)总请求次数
get_hits 总命中次数
get_misses 总未命中次数
evictions 为获取空闲内存而删除的items数(分配给memcache的空间用满后须要删除旧的items来获得空间分配给新的items)
bytes_read 总读取字节数(请求字节数)
bytes_written 总发送字节数(结果字节数)
limit_maxbytes 分配给memcache的内存大小(字节)
threads 当前线程数
相关文章
相关标签/搜索