On Tue, 8 Jun 2004, Haitao Jiang wrote:
> Each of 4 individual query only took <0.6 seconds,
> there is no other clients, it hardly to believe taht
> mysql query performance will degrade 300% (from <0.6s
> to ~1.9s) if we have 4 concurrent connections...
> As far as I know, MySQL should be able to handle
> hundreds of connections on a single CPU box without
> degrading performance like above.
You are completely missing the point.
It is nothing to do with concurrent _connections_ it has to do with
running concurrent _queries_.
What you are saying is like "well, if you can sit down and solve
this equation in 10 minutes, why does it take you 40 minutes to
solve 4 different equations?"
There is no magic way for the machine to do a hundred things at
once on a single processor (assuming you don't yet have a quantum
computer), they all get run for brief periods interleaved with one
another. If you are running 4 at once, then each will only run 1/4 of
the time. The box is working as hard as it can to process one query,
do you think it should slow down how quickly it processes one concurrent
query just so that number will change less if you have more than one?
I'll repeat what I said before: a query that takes 600ms on such a machine
is not a trivial query. If you real question is "why is my query so slow"
then you should probably ask that instead of getting confused about
why your machine can't do 4 things at once.
P.S. Please do not go around reposting your same question on multiple
lists, it has already been answered.