Install memcache to centos 5.x

Source: Internet
Author: User

Over the past few days, we have been working on performance improvement. We have been dealing with servers for a long time. Today we are mainly working on installing memcache, which is mainly used for database caching. If I have introduced something wrong, please give me more advice. After all, I am also exploring and studying this aspect.

All operations are performed under SSH and logged on with the root account.

My version is centos release 5.3 (final)
Use this command to know your Linux version
CAT/etc/RedHat-release

First install the libevent library.
CD/usr/local/src
Curl-O http://monkey.org /~ Provos/libevent-1.4.10-stable.tar.gz
Tar xzvf libevent-1.4.10-stable.tar.gz
CD libevent-1.4.10-stable
./Configure -- prefix =/usr/local
Make
Make install

Next, install memcached.

 

CD/usr/local/src
Curl-O http://www.danga.com/memcached/dist/memcached-1.2.8.tar.gz
Tar xzvf memcached-1.2.8.tar.gz
CD memcached-1.2.8
Ldflags = '-wl, -- rpath/usr/local/lib'./configure -- prefix =/usr/local
Make
Make install

After the installation is complete, run the following command as the user root to run memcache:
Memcached-u root-D-M 64-l 192.168.0.101-P 11211
Root is the executed user
64 is the cache size 64 m
192.168.0.101 is the IP address of the server
11211 is the port

Disable memcache
Pkill memcached

Next, install PHP-PECL-memcache.
A command.
Yum install PHP-PECL-memcache

If you still need PHP extension, use the following command:
PECL install memcache

Restart Apache and use phpinfo () to view the memcache part. If not, check the settings here:
/Etc/PHP. ini added extension = memcache. So
Of course, check whether memcache. So exists and whether it is under/usr/lib/PHP/modules/. If not, locate it and use the complete path.

You can use memcache. php to view the running status of memcache.
Memcache can be used only when web application support is required. For example, if phpBB 3 is used, memcache can be used. For details, refer to here.

It seems that the hit rate is still very high.

Related Article

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.