General Information

Memcached is a “distributed memory object caching system”. Useful for speeding up web applications by caching database lookups.

Official Site:


  • Distro(s): Enterprise Linux
  • Repo: EPEL (if using EL 5/6)

Install Memcached

  1. Memcached is in EL 7's base repo. If you are using EL 5/6, you will need to add the EPEL repo.
    1. Add the EPEL repo
  2. Install memcached
    yum install memcached
  3. Start and enable the service
    1. EL 6
      service memcached start
      chkconfig memcached on
    2. EL 7
      systemctl start memcached
      systemctl enable memcached

Configure Memcached

  • Edit the config file
    vim /etc/sysconfig/memcached
    # Daemon
    # Reserved Cache in MBs
    # Memcached Options - Listen on localhost only
    # Memcached Options - Clear out to listen on any interface
    # Networking
    • OPTIONS ⇒ Set other daemon options (see man memcaced)
  • If you made any config file changes, restart the service.

Memcached does not have any application authentication, so you should configure the memcached server with firewall rules to only allow certain sources to utilize it on tcp and udp port 11211 (the default port).

  • Either listen locally, or setup firewall rules to protect the cache.

  • linux_wiki/memcached.txt
  • Last modified: 2019/05/25 23:50
  • (external edit)