How to Install Memcached on Fedora 20

Cpanel/Whm License $3/mo Plesk License $10/mo Cloudlinux License $5/mo

Memcached is a distributed, high-performance, in-memory caching system that is primarily used to speed up sites that make heavy use of databases. It can however be used to store objects of any kind. Nearly every popular CMS has a plugin or module to take advantage of memcached, and many programming languages have a memcached library, including PHP, Perl, Ruby, and Python. Memcached runs in memory and is thus quite speedy, since it does not need to write data to disk.

Pre-Flight Check
  • These instructions are intended specifically for installing Memcached on a single Fedora 20 node.
  • I’ll be working from a sxi.io Web Self Managed Fedora 20 server, and I’ll be logged in as root.

Step #1 Install Memcached

First, clean-up yum:

yum clean all

As a matter of best practice we’ll update our packages:

yum -y update

Installing Memcached and related packages is now as simple as running just one command:

yum -y install memcached

Step #2: Configuration of the Memcached Installation

Use the following command to view information on the memcached command:

memcached -h

The default configuration file can be found at:

/etc/sysconfig/memcached

When started, Memcached will start on port 11211 by default per the default configuration file:

PORT=”11211″
USER=”memcached”
MAXCONN=”1024″
CACHESIZE=”64″
OPTIONS=””

To change the port (PORT), the user Memcached runs as (USER), the maximum number of allowed connections to Memcached (MAXCONN), or the cache size in megabytes (CACHESIZE), simply edit the configuration file.

For a refresher on editing files with vim see: New User Tutorial: Overview of the Vim Text Editor

EXAMPLE: If I wanted to run Memcached on port 1337, with 4GB of memory, and allow a maximum of 2,000 connections, I would change the config file as follows.

Let’s edit the configuration file:

vim /etc/sysconfig/memcached

To the following:

PORT=”1337″
USER=”memcached”
MAXCONN=”2000″
CACHESIZE=”4096″
OPTIONS=””

Exit and save the configuration file, and then restart Memcached

systemctl restart memcached

Step 3: Configure Memcached to Start on Boot

And then start Memcached:

systemctl start memcached

Be sure that Memcached starts at boot:

systemctl enable memcached

To check the status of Memcached:

systemctl status memcached

To stop Memcached:

systemctl stop memcached

Related posts

$1 Billion Blockchain Fund Launches with Chinese Government Backing

SXI ADMIN

Rapper 50 Cent Is Now a Bitcoin Millionaire

SXI ADMIN

DenyHosts: Remove / Delete an IP address

SXI ADMIN

US Government Taps Nonprofit to Research Digital Currency Crime

SXI ADMIN

Battle-Testing Lightning: Schools Start Contest to Secure Bitcoin’s Layer 2

SXI ADMIN

Bitcoin Bulls Seek Breakout to $10K or Higher

SXI ADMIN

Coinbase Halts Bitcoin Cash Trading Abruptly After Launch

SXI ADMIN

Fedora Linux Install Linux Kernel Headers And Developer Files

SXI ADMIN

Bitcoin Startup BitGo to Buy Asset Custodian

SXI ADMIN

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More