MEMCACHED ON CENTOS 7

INSTALLATION OF MEMCACHED ON CENTOS 7

Memcached is an opensource distributed memory object caching program that allows us to improve and speed up the performance of dynamic web applications by caching objects and data in memory.

It is also used to cache the entire database, queries, and tables to improve the performance of databases.

Installation

To install memcached packages, Run the below command:

#yum install memcached -y

Edit the memcached configuration file to enable or disable the features.

#vi /etc/sysconfig/memcached

 

 

 

There are some settings which are set by default.You can change it if necessary.

Here We are setting 256M caching

Start the memcached service

#systemctl start memcached.service

Enable the memcached service to run on boot:

#systemctl enable memcached.service

Confirm the Memcached Running Status

#memcached-tool 127.0.0.1:11211 stats

Firewall

We need to allow the following entry to all incoming connections on port 11211.

Make sure you have installed firewalld and its running.

#firewall-cmd –permanent –zone=public –add-port=11211/tcp

#firewall-cmd –reload

Install PHP Module

We need to install memcached PHP module to work with PHP 5.x

#yum install php php-pecl-memcache

Now,We need to restart memcached and apache service to take effect.

#systemctl restart memcached.service

#systemctl restart httpd.service

That’ All.We have successfully installed Memcached service to increase the performance of Web Applications and Databases.