Memcached (ii) installation

Source: Internet
Author: User

1 "libevent"

Select one of these to

1.1 Compile Installation

TAR-ZXVF libevent-1.4.14b-stable.tar.gz//First Decompression

CD libevent-1.4.14b-stable//Switch to libevent directory

./configure--prefix=/usr/libevent//Specify the installation path to the/usr/directory

Make//Compile

Make Install//installation

1.2 Ubuntu

Apt-get Install Libevent-dev

1.3 CentOS

Yum Install Libevent-devel

2 "memcached"

Decompression

TAR-ZXVF memcached-1.4.15.tar.gz

If you are compiling your own installation of "libevent", you need to take the parameters--with-libevent=/usr/libevent

CD memcached-1.4.15

./configure--prefix=/usr/local/memcached

Make-j4

Mkae Install-j4

3 "Start and stop"

Memcached-d-M 48g-p 11211-p/tmp/memcached.pid-c 1024-f 1.25-n 80-t 16

The-D option is to start a daemon,

-M is the amount of memory allocated to Memcache, in megabytes, I am 100MB here,

-t number of threads, default is 4, can be set according to the number of CPU threads, note that this parameter is particularly critical, set the number can not exceed the server CPU bus warning:setting A high number of workerthreads are not recommended . Set this value to the number of cores in your machine or less.

-U is the user running memcache, I am here root,

-L is a listening server IP address, if there are more than one address, I specify the IP address of the server 192.168.36.200,

-P is set memcache listening port, I set up here 11211, preferably more than 1024 of the port, we use this uniform 11211

The-c option is the maximum number of concurrent connections to run, the default is 1024, I set 256 here, according to the load of your server to set.

-P is set to save the Memcache pid file, which I am saving here in/tmp/memcached.pid

-F is the growth factor for chunk (default: 1.25)

-N is the chunk minimum size

-M is forbidden LRU (least recently Used)

-L Modify page size, default 1M, if you want to save large objects, this parameter must be modified

Ends the memcache process.

# Kill ' Cat/tmp/memcached.pid '

4 "View Hits"

4.1

Memcache View Hits

Telnet 192.168.1.1 11211

Enter the stats command after connecting the upper port

Where the CentOS installation Telnet client is as follows

Yum Install Telnet

4.2

Install libmemcached

Yum Install libmemcached

MemStat Servers=server1,server2,server3,...

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/tools/

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.