Quickstart

From The Waffle Grid Project

Jump to: navigation, search

Yesterday we announced what the Waffle Grid project is. Some people ignored it, others I am sure read it with curiosity, but i figure their is a small subset of folks out their who said: "WOW!!! That is really cool. I want a Waffle Grid now!"... I wonder if these are the same people who run out and buy the latest SSD harddrive because its fast and the latest nvidia card because they can one up all their friends... To those who want it now, but do not know where to begin I let me give you a quick install tutorial. Some of this already exists on the wiki, but hopefully I will make it clearer here.

Get two servers.... I will wait.

Ok back? Super.


Your going to need memcached installed somewhere... You can download it from http://www.danga.com/memcached/ , if you never installed it before you should look around and see what it is all about. You will also need to grab the libevent package which you can grab here: http://www.monkey.org/~provos/libevent/ ... or for those who are too lazy or too time constrained to grab the source, apt-get install memcached or yum install memcached depending on your linux distro should do the trick.


We make use of libmemcached, so go grab libmemcached (http://tangent.org/552/libmemcached.html)


Compile and install libmemcached. For decent performance (200x increase with 16k block), edit libmemcached/memcached_constants.h and rise MEMCACHED_MAX_BUFFER to 16500.


The patch is out on launchpad [1] along with a full patched source tree of MySQL 5.4. If you have never used launchpad their are plenty of decent resources out their to help you with this one. From now, I will consider you downloaded the patched 5.4 source.

Unpack the source and copy compile-pentium-max-memc or compile-pentium64-max-memc, depending of your architecture, in the BUILD directory.


Compile mysql with the patch. You need to add the memcached library to the build script. See here for 32 bit compile-pentium-max-memc and here for 64bit compile-pentium64-max-memc.

./BUILD/compile-pentium-max-memc

sudo make install

Edit you my.cnf file for the WaffleGrid parameters

innodb_memcached_enable = [ 0 | 1 | 2 ]

Enable/Disable WaffleGrid. This parameter is dynamical. A value of 1 means non-LRU mode, caching the disk read and write. A value of 2 means LRU mode. Mode 1 is new with the Cream release. For best performance with mode 2, you need a reversed LRU logic memcached server. You can get such memcached server here.

innodb_memcached_servers = "server1,server2:port2,etc..."

The list of memcached servers, defaults to "localhost". This parameter is dynamic. The format is the same as supported by libmemcached.

innodb_memcached_print_stats = [ 0 | 1 | 2 ]

Print extra logging/debugging information to the error log. If you use values > 0, watch your the disk usage, it is fairly verbose.


Fire up memcached on your remote machines:

/usr/bin/memcached -m 1400 -p 11211 -u nobody -d

Setup MySQL as you normally would, and start it up.

You can monitor the hits in memcache with memstat -s SERVER_IP ...

Enjoy!!