memcached学习笔记

ubuntu下安装:

$ sudo apt-get install memcached

启动:

$ memcached -d

默认端口号为11211,可以通过ps查看:

$ ps -ef|grep memcached

使用Telnet测试:

查看状态:

$ telnet localhost 11211
Trying ::1...
Connected to shiroh-laptop.
Escape character is '^]'.
stats
STAT pid 2768
STAT uptime 4614
STAT time 1323677670
STAT version 1.4.7
STAT libevent 2.0.12-stable
...
STAT total_items 9
STAT evictions 0
STAT reclaimed 0
END

set操作(继续上面的telnet操作):

set name 0 0 7
amoblin
STORED
set gender 0 0 1
1
STORED

get操作:

get name
VALUE name 0 7
amoblin
END
get gender
VALUE gender 0 1
1
END

测试工具

自带memslap:

$ sudo apt-get install libmemcached-tools
...
$ memslap
tagged by
comments powered by Disqus