Home » Performance » MySQL » What is "normal" performance of the MySQL database?
What is "normal" performance of the MySQL database? [message #1699] Mon, 27 August 2007 07:43 Go to next message
sakuraji  is currently offline sakuraji
Messages: 2
Registered: August 2007
Junior Member
I have had a hosting account with a company (with good reputaion) which I have been very happy with for several years when using simple php and static html based sites.

However, recently I set up a database (wordpress) site and the performance of database queries seem poor to me (using MySQL).

Since I have no previous experience with databases, I want to check if this really is all that can be expected or if there is likely to be a problem somewhere.

The first access to my site, which according to wordpress means 64 queries to the database, often takes about 10 seconds. Subsequent accesses are then very fast (typically 0.2 seconds or so which include php etc), also to other pages which does different database queries than the first page. So it seems to me there is something slow with the initial connection.

According to my webhost this is because at the first access to the page the database needs to read from disk etc, but in subsequent accesses table-caching provides fast response from the database.

This makes sense, BUT is it really possible that it should take 10 seconds for the database access, even if tables are not in cache?

Some more info:
The load on the the database and the webserver (different machines) is very low, so CPU resources should not be a problem. The database is very little so far. The wordpress site has 9 posts and 9 comments...

[Updated on: Mon, 27 August 2007 07:44]

Re: What is "normal" performance of the MySQL database? [message #1701 is a reply to message #1699 ] Wed, 29 August 2007 19:19 Go to previous messageGo to next message
sterin  is currently offline sterin
Messages: 323
Registered: March 2007
Location: Sweden
Senior Member
Well the caching theory is correct that subsequent queries will be faster.

But 10 seconds sounds _very_ long if the database is small and the servers have very little load.

Have they checked that they don't have problems with reverse DNS lookups from the mysql server to the web server?


Or if they are using Windows as OS and the two servers aren't part of the same domain they can have an issue with windows domain authentication which happens implicitly before a tcp connection is established.

Re: What is "normal" performance of the MySQL database? [message #1702 is a reply to message #1701 ] Thu, 30 August 2007 03:41 Go to previous messageGo to next message
sakuraji  is currently offline sakuraji
Messages: 2
Registered: August 2007
Junior Member
sterin, thanks for your answer.

Do you know if there is any easy way I can debug the connection to the database and see what it is that takes time and check about the reverse dns issue etc. My host seems to be happy with the table cache answer, and I don't think they will do any more investigation. But to me it sound ridiculous if a simple database access should take 10 seconds....

I can access the webserver via ssh, and from there I can connect to the database server with the mysql client.

Re: What is "normal" performance of the MySQL database? [message #1703 is a reply to message #1699 ] Thu, 30 August 2007 06:41 Go to previous message
sterin  is currently offline sterin
Messages: 323
Registered: March 2007
Location: Sweden
Senior Member
Good, if you use the mysql frontend on the webserver, how long time does a query like this take:
mysql -u[youruser] -p[yourPassword] -e 'SELECT 1' [yourDatabase]


It should return immediately since it doesn't actually access any table, if it doesn't then you probably have a problem with the DNS.

Previous Topic:remove temporary table
Next Topic:Monitoring MySQL Queries
Goto Forum:
  



Current Time: Thu Jan 8 17:17:21 EST 2009

Total time taken to generate the page: 0.01749 seconds
.:: Contact :: Home :: MySQL Support by Percona.com ::.

Powered by: FUDforum 2.7.5.
Copyright ©2001-2006 FUD Forum Bulletin Board Software

MySQL Performance | Forum authority Badge