I have a mysql database that is currently running very slow. There are a number of databases on the server, and all other databases are running fine, however this one database is very slow, often taking between 2-10 seconds for a very simple update (updating 1 row in a small table) or select query (selecting 1 row from a small table).
My question is to ask if anyone could think of a reason why this one database is running so slow. The traffic is minimal (it is the database for the development site). I have ruled out my scripts, as phpMyAdmin is also very slow and often times out with this database. I have also checked the running processes to check nothing untoward is there, and there can be no processes ongoing, but still the database will be running really slowly.
So please can anyone shed some light on what may be happening here. I am very happy to give extra information if you require it.
EDIT:
Further to the comments, here is an example of a slow running query:
UPDATE `Users` SET `last active` = 1334763602 WHERE `ID` = 1
This simple update query is taking between 2 and 10 seconds to complete. ID is a primary key and this table has around 30 records.
Further to my initial problem, it does seem as if SELECT is not as bad, though I have seen slow periods for SELECT, a lot of SELECT statements currently are running fast, whereas UPDATE is still slow.
EDIT 2:
After more investigation it appears it might be tied to the InnoDB table type. I have changed a table to MyISAM and a query that was taking 1.5 seconds in InnoDB took just 0.0006 seconds in MyISAM. I guess my question becomes how do I best tune to InnoDB tables?
It looks like the issue was to do with the database setup and the InnoDB tables. When the database was using MyISAM it worked fine, so we investigated this and it turns out the default buffer pool size was too small, causing memory issues. Having upped the value for the default buffer pool size, the database is performing much faster, (probably in the region of 1000 times faster if not more).