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.
To install memcached packages, Run the below command:
#yum install memcached -y
Edit the memcached configuration file to enable or disable the features.
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
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
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.