Memcached is free&open source, high performance, distributed memory object caching system used generally for web applications. Memcached is in-memory key-value store.As we will see in next chapters Memcached is simple but powerful.
Memcached was originally developed by Brad Fitzpatrick for LiveJournal in 2003.
We will install Memcached in Fedora. It is similar for other distributions.
$ dnf install memcached Failed to set locale, defaulting to C Dependencies resolved.
Check Memcached Service Status
Memcached runs as a service. So to work with it we need to check status of the memcached service with systemctl command.
$ systemctl status memcached ● memcached.service - Memcached Loaded: loaded (/usr/lib/systemd/system/memcached.service; disabled; vendor preset: disabled) Active: inactive (dead)
Start Memcached Service
It seems the service is not started yet and we need to start it and chec again the status of service to be sure.
$ systemctl start memcached $ systemctl status memcached ● memcached.service - Memcached Loaded: loaded (/usr/lib/systemd/system/memcached.service; disabled; vendor preset: disabled) Active: active (running) since Tue 2016-10-18 03:05:57 UTC; 2s ago Main PID: 14650 (memcached) Tasks: 6 (limit: 512) Memory: 1.1M CPU: 2ms CGroup: /system.slice/memcached.service └─14650 /usr/bin/memcached -u memcached -p 11211 -m 64 -c 1024 Oct 18 03:05:57 poftut3 systemd: Started Memcached.
Start Memcached as Daemon
We have started the memcached service but if we want to start it as daemon we can use -d option.
$ memcached -p 11111 -U 11111 -u root -d
We have started a memcached daemon process with.
- -p for tcp port to listen
- -U for udp port to listen
- -u for username
- -d for to run daemon process