Memcache is a high-performance, distributed memory object caching system for reducing database load and increasing access speed in dynamic applications. It is said that the official says its users, including Twitter, Digg, Flickr, and so on, are some of the biggest internet celebrities. The current use of memcache to solve large users on the Internet is a very popular use of reading.
Download installation
Downloaded, I went to its official (http://memcached.org/), currently the latest download version is 1.4.5
Also need to install libevent this software, from the official (http://monkey.org/~provos/libevent/) download, the current stable version is 1.4.14.
After downloading, upload it to the/home/blue/below
Execute the following command
start the Memcache service
Enter the bin directory, execute:./memcached-d-M 1024-u Blue, but the system says a shared library is not loaded, the name of the shared library is: libevent-1.4.so.2
The first thing to look at is where the link library address memcached This command is used. Perform the following command to view:
Ld_debug=libs/usr/local/memcached/bin/memcached-v
Show Memcache from where to find libevent-1.4.so.2 this file, so, we only have to assign libevent-1.4.so.2 this file to any of the above directory. Here we assign it to/lib64/below. Make a soft connection. The command is as follows:
Ln-s/usr/local/lib/libevent-1.4.so.2/usr/lib/libevent-1.4.so.2
At the start of the Memcache service:./memcached-d-M 1024-u Blue can do it.
The following parameters of the memcached command are Ollon as follows,
#/usr/local/bin/memcached-d-M 200-u root-l 192.168.1.91-p 12301-c 1000-p/tmp/memcached.pid The relevant explanations are as follows: the-D option is to start a daemon,-m Is the amount of memory allocated to Memcache, in megabytes, where 200mb-u is the user running memcache, and if it is currently root, the user needs to be specified using this parameter. -L is the server IP address of the listener, if there are multiple addresses, I specify the IP address of the server here 192.168.1.91-p is set memcache listening port, I set up here 12301, preferably more than 1024 of the port-C option is the maximum number of concurrent connections, the default is 1024, where the 256-p is set to save Memcache PID text Pieces, I am here to save in/tmp/memcached.pid stop memcache process: # kill ' Cat/tmp/memcached.pid ' can also start multiple daemons, but the port cannot be duplicated
The first "-D" parameter needs further explanation.
-D Install memcached-d uninstall Uninstall memcached-d start start memcached service-D Restart Restart memcached service-D stop Stop memcached service-D SHUTD Own Stop memcached Service
Check Service:
1. Check the Memcache service for startup:
Netstat-lp | grep memcached
2, check the process number of memcache (according to the process number, you can end the Memcache service: "kill-9 process number")
Install and set memcache under Linux (GO)