Skip to main content
Call us
Phone numbers and hours
Help Center

Explore our online help resources

BlogHelp

GoDaddy Help

Install the Memcached daemon

Memcached is a free and powerful object caching system that you can install to improve the performance of your website. Memcached will only work if you install the daemon, install the PHP libraries and configure your PHP application properly.

On CentOS servers, installing the Memcached daemon is done from the command line and is independent of any control panel you may be using (WHM/cPanel or Plesk).

  1. Enable administrator access on your Gen 3 or Gen 4 server if you haven't already done so.
  2. Connect to my server with SSH (Secure Shell).
  3. Switch to the root user.
  4. Install Memcached using YUM.
    yum -y install memcached
    
  5. Configure Memcached to start automatically at boot time.
    systemctl enable memcached
    
  6. Change the Memcached configuration to make the service more secure and to configure the amount of RAM to allocate.
    1. Edit the configuration file with your favorite text editor.
    2. vim /etc/sysconfig/memcached
      

      This is how the configuration file looks by default:
      PORT="11211"
      USER="memcached"
      MAXCONN="1024"
      CACHESIZE="64"
      OPTIONS=""
      
    3. It's important to update the OPTIONS line to bind Memcached to localhost and to disable UDP traffic, protecting from certain attacks.
    4. OPTIONS="-l 127.0.0.1 -U 0"
    5. You also need to configure CACHESIZE to the amount of RAM you'd like to use. This depends on how much total RAM the server has, but 512M to 1024M is often a good place to start.
    6. CACHESIZE="1024"
  7. Once the file is modified, it should look something like this.
  8. PORT="11211"
    USER="memcached"
    MAXCONN="1024"
    CACHESIZE="1024"
    OPTIONS="-l 127.0.0.1 -U 0"
    
  9. Save the file.
  10. Restart Memcached to reflect your changes.
  11. systemctl restart memcached
    

Related Steps

More info

  • Our server experts can perform these steps for a fee. For more information about our Expert Services, please visit our Expert Service menu.

Community Related

ParleG's Avatar
How to implement Memcached & APCu functionality

2 Replies

Last posted 3 months ago.

DocHan's Avatar
error message

1 Replies

Last posted over 3 years ago.

Bramey351's Avatar
Enabling Caching Methods

4 Replies

Last posted over 4 years ago.

Don't see what you are looking for? Search the Community