Installation of Memcache under Linux

Source: Internet
Author: User

Memcache is a high-performance, distributed memory object caching system for reducing database load and increasing access speed in dynamic applications. At present, using memcache to solve the large-user reading on the Internet is a very popular usage, which has been widely used in Internet enterprises.
For more information about Memcache, interested friends please refer to this article: http://blog.csdn.net/xifeijian/article/details/21994941
1. Download Memcache
Wall crack recommended official download (http://memcached.org/), so far, the latest download version is 1.4.17,

After downloading, upload it to Linux and upload it to/root/src/below.

Execute TAR-XVF memcached-1.4.17.tar.gz, under/root/src/, will extract a memcached-1.4.17 folder.
Next, enter the memcached-1.4.17 directory and execute the./configure?-prefix=/root/local/memcached-1.4.17 command, which indicates that the installation is in =/root/local/ memcached-1.4.17 directory,
Wait for the program configuration,
?
Please check configure, if there is an error message, here is prompted to install libevent, then we first install libevent.

Follow the prompts to download libevent and install, Libevent installation Step 3 steps:
1, decompression libevent bag, ZXVF libevent-2.0.4-alpha.tar.gz
2, enter the extracted directory, execute configure,/configure--prefix=/root/local/libevent2.0.4
3. Execute make && make install

At this point, the libevent installation is complete.
Then we continue to install memcache.
1, enter the memcached-1.4.17 directory, execute./configure--prefix=/root/local/memcache1.4.17--with-libevent=/root/local/ libevent2.0.4/
.......................................................................
Wait, found that configure now no longer an error.
.......................................................................

2. Execute make && make install

At this point, memcache even if installed, forced to want to start a memcache bar ~ ~
? Enter the bin directory, execute:./memcached?d?m?28?u 爎 oot,?? Smooth, successful start.

?
The common startup parameters for the memcached command are as follows:
#?root/local/bin/memcached?d?m?00?u 爎 Oot?l?92.168.1.91?p?023-c?56-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, 200MB
-U is the user running memcache, and if it is currently 爎 oot, you need to specify the user with this parameter.
-L is the server IP address of the listener, if there are multiple addresses, I specify the IP address of the server 192.168.1.91
-P is the port that sets Memcache listening, I set here 9023, preferably more than 1024 ports
The-c option is the maximum number of concurrent connections to run, which defaults to 1024, which is set to 256
-P is set to save memcache PID file, I am here to save in? tmp/memcached.pid

Stop memcache process: kill smoked cat?tmp/memcached.pid ', we can also start multiple daemons, but the ports cannot be duplicated.

Installation of Memcache under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.