Memcached is a high-performance caching system that is primarily used to speed up sites that rely on databases. It is an in-memory system for storing any data that could be from database calls or page requests. To read more about Memcached you can view the project wiki on github
Clean out the repository:
yum clean all
Make sure everything is to date:
yum -y update
Install memcached and libevent-devel:
yum -y install memcached libevent-devel
Verify the configuration
nano /etc/sysconfig/memcached
You should see the following configuration information:
PORT="11211" USER="memcached" MAXCONN="1024" CACHESIZE="64" OPTIONS=""
Start memcached:
systemctl start memcached
Make sure it persists on reboot:
systemctl enable memcached
To make sure it is running you can telnet to the port you ran it on and type stats
$ telnet localhost 11211 Trying ::1... Connected to localhost. Escape character is '^]'. stats STAT pid 6331 STAT uptime 43199874 STAT time 1500745928 STAT version 1.4.10 STAT libevent 1.4.13-stable STAT pointer_size 64 STAT rusage_user 645.228910 STAT rusage_system 1121.041575 STAT curr_connections 10 STAT total_connections 11 STAT connection_structures 11 STAT reserved_fds 20 STAT cmd_get 0 STAT cmd_set 0 STAT cmd_flush 0 STAT cmd_touch 0 STAT get_hits 0 STAT get_misses 0 STAT delete_misses 0 STAT delete_hits 0 STAT incr_misses 0 STAT incr_hits 0 STAT decr_misses 0 STAT decr_hits 0 STAT cas_misses 0 STAT cas_hits 0 STAT cas_badval 0 STAT touch_hits 0 STAT touch_misses 0 STAT auth_cmds 0 STAT auth_errors 0 STAT bytes_read 7 STAT bytes_written 0 STAT limit_maxbytes 1073741824 STAT accepting_conns 1 STAT listen_disabled_num 0 STAT threads 4 STAT conn_yields 0 STAT hash_power_level 16 STAT hash_bytes 524288 STAT hash_is_expanding 0 STAT expired_unfetched 0 STAT evicted_unfetched 0 STAT bytes 0 STAT curr_items 0 STAT total_items 0 STAT evictions 0 STAT reclaimed 0 END
That is it for installing memcached on CentOS.