Sunday 21 November 2010

Clearing the global status

If you want to clear local session status variables this is easy, simply execute FLUSH STATUS.  Unfortunately doing the same for global status variables is not as easy.

That is until now.  In the Drizzle7 beta release 2010-11-08 is a new command: FLUSH GLOBAL STATUS

I created this command to fulfil a Rackspace feature request but it appears this has also been a MySQL feature request in the past.  The implementation would be very different in MySQL since the status variables and sessions work differently, but it would certainly be good to see in a future release, and it appears patches already exist for it.

Friday 12 November 2010

Rackspace Rookie Orientation

I have been meaning to write about Rackspace's Rookie Orientation for a while, especially since Stewart Smith already wrote about his experience.  My orientation happened in the London offices in early October, it is a 4 day session in which we learn about and indeed get a feel for the culture at Rackspace as well as meeting many people and finding out about their roles along the way.  Yes there were presentations, but they were all done in a fun way.

Before Rackspace I have been to two orientations:

The first back in 2001 (during 9/11) was for a very large UK company and it was a week of team building and training us immoral sales tactics and even some things which would break trading standards laws (needless to stay I didn't hang around in that company for long).

The second was after one company I worked for got bought out by another (not Sun-Oracle), all I can really remember from this was the CEO used to get stoned a lot and got jailed for a publication a long time ago.

So what can I take away from the Rackspace Orientation?

I met some great people, we had a good time, we even made a video (which I won't show).  I got a real feel for the Rackspace culture which is very much what I hoped for.  Yes there were presentations, but presentations with explosions, a chicken, top-hats, wrists tied up in rope and one guy dressed as a semi-naked superhero.  This is not your average orientation :)

During the week we were split into four teams and there were two prizes.  The first was for the team who got the most points, my team (Rack'n'Rollers, see photo) won that award.  There was also a prize called 'Natural Born Racker' which was voted for by everyone at the orientation.  I won that prize and would really like to thank everyone who voted for me :)

My team's photo, I'm the one in the green top.


I admit I spent a lot of the week thinking about the work I need to catch up on, but it was an 'awesome' week.

Sunday 7 November 2010

New global buffer constraints in Drizzle

Both MySQL and Drizzle have buffers such as sort and join buffers which have size parameters to tune them.  Unfortunately these settings are per-client, so if you have thousands of clients all using these buffers you could easily exhaust the RAM of a server.  Especially if they are set quite high.

So in the latest Drizzle trunk (and the release due in the next few days) I have introduced global buffer constraints.  These constraints make sure that between all the clients there is a cap on how much RAM can be allocated to a buffer.

This was a task the Rackspace Cloud team requested be implemented and I have also seen (and subsequently lost the link to) a blog which discusses the possibility of something similar in MySQL.  If anyone has seen the blog post I am talking about please let me know :)

How this is implemented


For each buffer type there is a new atomic counter which is keeping account of the allocations for each buffer type.  If one of theses counters hits a cap then the query executing when the cap is hit will return an error.  So far I have added this to 4 buffers which are sort buffer, join buffer, read buffer and read rnd buffer.  The new options for these are:
--join-heap-threshold

--read-buffer-threshold

--read-rnd-threshold

--sort-heap-threshold

By default all are set to 0 which means unlimited, and cannot be set lower than their associative settings (eg. sort-heap-threshold cannot be lower than sort-buffer-size).

I would typically expect this would be used most in cloud scenarios where the virtual servers could have a limited amount of RAM and swap available.