memcached

Cache everything that is expensive to compute/fetch

 

UDFs (user defined functions)  把memcached集成到MySQL中去

 

 

用途

memcached 可以用来缓存key:value,也可以用来缓存key:file

 

BUILD & INSTALL

翻了很久,没有发现Memcached有官方文档,莫非它真的简单到文档都是多余的?

 

首先,Memcached是使用LibEvnet库来实现异步IO的,先装LibEvent先

 

tar -zxvf libevent-1.4.13-stable.tar.gz

cd libevent-1.4.13-stable

./configure #将会装在/usr/local/lib中,参见./configure --help

make

make install #可以用ldconfig使Lib生效

 

 

tar -zxvf memcached-1.4.5.tar.gz

cd memcached-1.4.5

./configure #将会在/usr/local/lib中寻找libevent,将会装在/usr/local/lib中

make

make install

 

 

TEST

 

memcached -d -m 128 -p 11211 -u daemon # 参见man memcached

printf "set abc 0 0 5/r/n12345/r/n" | nc localhost 11211                      

printf "get abc/r/n" | nc localhost 11211                                     

printf 'stats/r/n" | nc localhost 11211 

 

你可能感兴趣的:(memcached)