Book Image

Getting Started with Memcached

By : Ahmed Soliman
Book Image

Getting Started with Memcached

By: Ahmed Soliman

Overview of this book

<p>Web application performance is no longer a non-functional requirement, but an implicit condition for an engaging user experience. As a result, responsive and highly scalable applications are becoming a necessity. Memcached is a high-performance distributed memory caching system built to speed up dynamic web applications by offloading pressure from your database. <br /><br />Getting Started with Memcached is a hands-on, comprehensive guide to the Memcached service and it’s API in different programming languages. It contains practical recipes to integrate Memcached within your Rails, Django, or even Scala Play! applications.<br /><br />This book will show you everything you need to know to start using Memcached in your existing or new web applications.<br />This book uses real-world recipes to help you learn how to store and retrieve data from your clustered virtual memory cache pool and how to integrate caching into your favourite web development framework.</p> <p><br />You will also learn how to build a Memcached consistent-hashing scalable cluster and how Memcached clients are properly configured to use different servers to scale out your memory cache pool in Ruby, Python, PHP, and Java. With this book, you will see how to cache templates and database queries in the most popular web development framework in use today.</p>
Table of Contents (9 chapters)

Compiling memcached from a source on Ubuntu (Simple)


In some cases, you might want to enable some of the memcached features that have to be baked-in during the compile time of the program. In this recipe, we will learn how to compile memcached from a source on Ubuntu

Getting ready

We will install the requirements of the package by using apt-get:

sudo apt-get install g++ make libevent-dev

This installed the C++ compiler , make, and the libevent library headers needed to compile memcached.

How to do it...

  1. Let's download the latest version of memcached in your home directory

    
    curl -O --location http://memcached.org/latest
    mv latest memcached-latest.tar.gz
    tar vxzf memcached-latest.tar.gz
    
  2. Next, let's configure and compile

    cd memcached-*
    ./configure && make
    
  3. If the compilation process went well, we install the binaries:

    sudo make install