GoDaddy Ayuda

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.
    CentOS/AlmaLinux users:
    yum -y install memcached
    
    Ubuntu users:
    apt 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. CentOS/AlmaLinux:
      vim /etc/sysconfig/memcached
      
      Ubuntu:
      vim /etc/memcached.conf

      Default values:
      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. Note: This setting is in memcached.conf by default.
    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.