Most coders don't seem to notice that MySQL needs to be configured properly in order it to perform well, too often there is out of the box installation of it and untouched my.cnf file. Means trouble at some point.
There's an easy way to do basic configuration with mysqltuner perl script. Go and test it now.
https://launchpad.net/mysqltuner | direct download: wget mysqltuner.pl
Another hint. If you're using MySQL 5.5, you can gain lot's of more performance by disabling logging via my.cnf.
- innodb_support_xa = 0
- innodb_flush_log_at_trx_commit = 0
- sync_binlog = 0
There seems to be a bug and with that on, even older versions are much more rapid than 5.5