dien thoai di dong , dau gia , the gioi smartphone , download game mobile , smartphone , tang truong , khoa hoc cong nghe thong cong , mua ban sim , Smartphone gia re , cong nghe tuong lai , cong nghe 360 , giai tri guongmat.org , su kien trong ngay , thoi trang hi tech , thong tin 360 , may tinh bang , perfect body , kasuman.com , gia vang hom nay , tin tuc an toan , kinh te viet nam , xay dung viet nam , thoi trang , thoi trang , phu nu viet nam , tin tuc moi online , dich vu bao ve viet nam , bao ve viet nam , cong ty bao ve viet nam , tin tuc moi online , giai tri 24h , tin tuc 24h


 21 Jun 2010 @ 8:19 AM 

Memcache is a very simple caching system that uses memory to store objects. As you may already know, memory is faster to read than hard drive. A site will take a lot less time to read a database result cached in memory. To make the best use of memcache, you should install the memcached module. For this post we used Ubuntu Server 10.04, but all commands should work on most Ubuntu editions.

I have chosen to use memcached, rather than memcache. Have a look here to view a comparison

First, install the memcached package, php-pear (required for pecl), php5-dev (required for phpize) and libmemcached-dev

sudo apt-get install memcached
sudo apt-get install php-pear
sudo apt-get install php5-dev
sudo apt-get install libmemcached-dev

next, install memcached using pecl

sudo pecl install Memcache

Also, we need to enable the memcache extension on php:

sudo echo "extension=memcache.so" > /etc/php5/apache2/conf.d/memcache.ini

Add the following line to your php.ini file.

memcache.hash_strategy="consistent"

You can add it anywhere in the file.

Next you need to start an instance of memcache, you can start a daemon with the following command:

memcached -d -m 2048 -l 10.0.0.40 -p 11211

If you are only using a single server, then you only need to include this line to your site’s settings.php file.

$conf['cache_inc'] = '/sites/all/modules/memcache/memcache.inc';

The final step is to restart apache and then switch your site back online if it was offline.

Posted By: Zayin
Last Edit: 21 Jun 2010 @ 08:34 AM

EmailPermalink
Tags
Tags: ,
Categories: linux, php


 

Responses to this post » (3 Total)

 
  1. zayinkrige says:

    New Blog Post -> Installing memcached on ubuntu 10.04 – http://www.zayinkrige.com/installing-mem

  2. ehcache.net says:

    Installing memcached on ubuntu 10.04…

    Memcache is a very simple caching system that uses memory to store objects. As you may already know, memory is faster to read than hard drive. A site will take a lot less time to read a database result cached in memory. To make the best use of memcache…

  3. I think this is one of the most significant information for me.
    And i am glad reading your article. But should remark on some general things,
    The web site style is wonderful, the articles is really great :
    D. Good job, cheers

    Here is my site Play Gold Miner Games, http://www.potluckster.com,

Post a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


 Last 50 Posts
 Back
Change Theme...
  • Users » 1
  • Posts/Pages » 40
  • Comments » 76
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

Links



    No Child Pages.

Portfolio



    No Child Pages.