How to Install and Configure Memcached on CentOS?

What is Memcached?

Memcached is a db memory caching system that takes your data from the database and stores it in the server memory so it can be retrieved much faster and thus speeds up your site

Steps to install Memcached on CentOS

Execute the following command to install Memcached

yum install memcached

Modify the default Memcached cache size to fit your memory requirements, the greater the better but of course that depends on how much memory you have and how much of that you want to allocate to Memcached

Edit the Memcached configuration file

vi /etc/sysconfig/memcached

Set CACHESIZE="XXXX" where you should put the amount of memory in megabytes

Save the file and set memcached to run at startup

chkconfig memcached on

Start the memcached service

service memcached start

That's it! now you have Memcached installed on your server, you now need to configure your website to make use of it's amazing capabilities

I hope you've enjoyed this tutorial and stay tuned for more to come

Share this post