Linux compiled installation memcached

Source: Internet
Author: User
Tags memcached

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

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.