A table for 200,000 – quick website database table optimisation

A huge increase in traffic working with http://www.loverugbyleague.com has led us to looking at many ways to help improve the way the site works to try and squeeze more performance out of the current server. One of the first things that was noticed was that with the increase in access the database tables were locking up and delaying return of results and causing problems.

A look into the setup of the database exposed an issue as all the tables were using MYISAM which, as far as I know, used to be the default for a phpmyadmin table. I’m sure all but the most savvy of us give little thought to the type of storage engine we use for a table and just stick with the default, however it became apparent MYISAM was causing us a few problems and isn’t really suitable for high traffic, high access sites.
The problem comes with the fact that MYISAM will lock up an entire table when doing anything on a row, including accessing, updating and inserting rows, and as a result requests quickly queue up and start to grind everything to a halt during high traffic periods.

The tables were therefore switched to InnoDB which works with row level locking, meaning that rather locking up the entire table it will lock up only the row in use and allow the rest of the table to be accessed. This means that multiple requests can be made to the same table at the same time provide they are reading/updating different rows. It is much more suited to high access on large tables, especially where different rows are being accessed in the table, if the same row needs to be accessed repeatedly it may be worth looking at some caching of that information.

The change quickly reduced the number of locked requests and things started to run a bit more smoothly. There have been other things looked at to help optimise the site and it’s quickly apparent there is a huge amount to do in helping squeeze out every bit of performance of a site but taking little steps like thinking more about your database storage can really start to help.

A look ahead to the rest of 2012

V for Vendetta

IMG Source: http://www.flickr.com/photos/kashklick/3406150405/sizes/m/in/photostream/

A little late, this post was supposed to go up on Six Revisions at the start of the year as “Five things that will keep shaping the web in 2012” however there were a few issues over there so I’ve decided to publish it here anyway. As it was written at the end of December some of the things may already have moved on a little.

So having looked back at last year’s predictions and having survived a sober new years eve (I was driving and had places to be on New year’s day) I’m back to have a look at what 2012 might have in store for us.
Continue reading

The site gets a new look

Kamikaze Music old design
If you’ve made your way to the site since last night you’ll have seen the new look (a picture of the old one is above if you can’t remember it). I’m not sure if it would be classed as a redesign or realign, but it’s the biggest overhaul I’ve done in a while. I had a few new things I wanted to try out and I had some ideas that had sat around for ages, plus the site was seeming a little sluggish so I got stuck into it and decided to get it done at the weekend.
Continue reading

It’s hip to be square

How long have people coveted the joyous features that CSS3 is now bringing to your browser? How long have we spent hacking around trying to create gradients and rounded corners to now have these very things easily at our fingertips. Quite a good damn while and I for one am very grateful for the new found ease and flexibility we have in deploying these features even if there is not full support everywhere.

Not so long ago I put together an article for Smashing Magazine about using CSS3 and I did mention that using CSS3 features would not be suitable for every situation and that they should be used sensibly and not just splashed everywhere and I think a sign of the maturity and true usefulness of CSS3 will come as people realise this and use it where it is truly necessary, using it as a design tool and not include it just for the sake of it (1px white text shadow springs to mind again!).

So I was rather pleased to see Google+, ok Google haven’t been praised for their groundbreaking design in the past but Google+ is a really well put together and visually appealing design and it’s mostly square. There are the odd subtle rounded corners but on the whole there are a lot of straight edges meeting straight edges with no hint of curve and it looks lovely, you don’t look at it thinking “Oh if only they’d rounded the corners of that button”. It’s not like Google are completely blind to CSS3, there’s plenty used around the Google+ site and the other redesigns of the Google network of sites, no they have chosen to leave square edges in without a hint of remorse.

Yes ladies and gentleman just because you know how to use a gradient doesn’t mean you have to, just because you know all of the border-radius web prefixes by heart doesn’t mean you need to use them – it is hip to be square.

(If you’re looking for something to do whilst you’re not using CSS3 how about checking out Paul Boag‘s post on Web Designer Depot – Stop obsessing over HTML5 and CSS3)