Help - Search - Members - Calendar
Full Version: Slow mysql
The Planet Forums > Control Panels > cPanel/WHM
wassily
The number of queries per second is really really low icon_smile.gif

9:25am up 8:06, 1 user, load average: 0.93, 0.49, 0.24
112 processes: 110 sleeping, 1 running, 1 zombie, 0 stopped
CPU0 states: 0.1% user, 0.0% system, 0.0% nice, 99.0% idle
CPU1 states: 0.0% user, 0.0% system, 0.0% nice, 100.0% idle
CPU2 states: 0.0% user, 0.0% system, 0.0% nice, 100.0% idle
CPU3 states: 0.0% user, 0.0% system, 0.0% nice, 100.0% idle
Mem: 1030676K av, 631492K used, 399184K free, 0K shrd, 103924K buff
Swap: 2048276K av, 5072K used, 2043204K free 299128K cached

Key Reads/Key Read Requests = 0.012531 (Cache hit = 99.987469%)
Key Writes/Key Write Requests = 0.043478
Connections/second = 0.088 (/hour = 317.058)
KB received/second = 0.021 (/hour = 76.216)
KB sent/second = 0.019 (/hour = 68.376)
Temporary Tables Created/second = 0.001 (/hour = 2.613)
Opened Tables/second = 0.004 (/hour = 15.679)
Slow Queries/second = 0.000 (/hour = 0.000)
% of slow queries = 0.000%
Queries/second = 0.276 (/hour = 992.983)

I don't think it has anything to do with my my.cnf setting because no matter what I do Queries/second never rises. I tried a default my.cnf with only max_connections=500. Also tried mysql 3 and 4.

Its a Dual Xeon 2GHz, 1Gb server without any live websites at the moment

Anyone? icon_smile.gif
Dave#
QUOTE
Its a Dual Xeon 2GHz, 1Gb server without any live websites at the moment


Then how can you raise Queries/second unless you have traffic?

More traffic = More Queries
shykot
as the hits increases, the site tries to call multiple connections to the database and hence the load.

Better keep a continuous check on mysql and try restarting whenever necessary
jough
Here's a noob question: how do you see the above statistics?
wassily
thanks guys, I figured it was a lack of trafic problem

I added the script that gives you these stats (took it from a post on this forum)

edit in your mysql username and password
jough
Great script! Thanks for the link.

One question, though: how fast *should* a "queries per second" be? Is 100 good? What about 20?

And what can you do to speed up the queries per second? (I realise that there are many things, but in general).
Dave#
QUOTE
And what can you do to speed up the queries per second?


Have a busier site?
jough
No, having a busier site won't speed up mysql. In fact, it could have the opposite effect.

Right now I have a site that's busy enough that mysql pretty much *always* has something to do. I just have no idea what the queries per second number *means*. How many queries per second is good performance (assuming that mysql was handling queries as quickly as it could).

I know the more queries per second, the better. But is 80 QPS good performance, or should it be in the thousands?

I was thinking more about the my.conf configuration than the overall traffic of a site.
Dave#
QUOTE
Originally posted by jough
No, having a busier site won't speed up mysql.  In fact, it could have the opposite effect.  

Right now I have a site that's busy enough that mysql pretty much *always* has something to do.  I just have no idea what the queries per second number *means*. How many queries per second is good performance (assuming that mysql was handling queries as quickly as it could).

I know the more queries per second, the better.  But is 80 QPS good performance, or should it be in the thousands?

I was thinking more about the my.conf configuration than the overall traffic of a site.


So your looking at queries per second to determine how efficient MYSQL is?

That is nonesene.

Look at 'Slow_queries' and '% Slow_queries' or use some bench tools like sql-bench - included with the distribution.
jough
Why is that nonsense? You benchmark printers by how many pages per second they can print. You benchmark CPUs by how many instructions per second they can process.

How is it different to benchmark mySQL based on how many queries per second it can process?

And if not queries per second, what should one use to determine if their configuration is optimised?
Dave#
You wouldn't say apache was optimised just because it was doing 250 requests a second,just that it was a busy server.

If you want a higher number of queries per second just throw more traffic at mysql but all you haved proved is that you have given it more traffic not that it is more efficent.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.