Memcached is a high-performance distributed memory object caching system for dynamic Web applications to mitigate database load.
It improves the speed of dynamic, database-driven Web sites by caching data and objects in memory to reduce the number of times a database is read.
Memcached is based on a hashmap that stores key/value pairs. Its daemon (daemon) is written in C, but the client can
Written in any language and communicates with the daemon through the memcached protocol.
1.memcached Installation:
Installation Development Kit: Yum-y Install GCC
Install memcached dependent components:
Yum-y Install libevent Libevent-devel
#apt-get Install Libevent-dev
wget http://memcached.org/latest
#wget http://www.memcached.org/files/memcached-1.4.31.tar.gz
Tar zxvf memcached-1.x.x.tar.gz
CD memcached-1.4.31
./configure--prefix=/usr/local/memcached
Make && make install
2. Start memcached
Memcached-d-M 10-u root-l 192.168.0.3-p 12000-c 256-p/tmp/memcached.pid
Parameter description:
-D is to start a daemon
-M is the amount of memory allocated to Memcache, in megabytes
-U is the user running Memcache
-L is the server IP address of the listener
-P is the port that sets Memcache listening, preferably a port above 1024
The-c option is the maximum number of concurrent connections to run, which is 1024 by default and is set according to the load on your server
-P is a PID file that is set to save Memcache
3.memcached command
See if it starts up: Ps-ef | grep memcached
4. Compile and install memcached error:
Checking for libevent directory ... configure:error:libevent is required. You can get it from http://www.monkey.org/~provos/libevent/
If it ' s already installed, specify its path using--with-libevent=/dir/
is required to execute the libevent library file.
Installation:
Yum-y Install libevent Libevent-devel
Find out if the Libevent library exists
Find/-name libevent*
Recompile:
./configure--prefix=/usr/local/memcached
This article is from "Yangdong Hao" blog, please make sure to keep this source http://506554897.blog.51cto.com/2823970/1854962
Linux compiled installation memcached