mysql increase queries per second avg

my queries per second avg are very very low
Queries per second avg: 6.591
most other linux machines are at 20 with an i686
what variables control this in my.cnf
what is average for mac on queries per second?
what are you people getting for queries per second?

Any help would be great

Posted on Aug 10, 2005 12:02 PM

Reply
13 replies

Aug 10, 2005 5:49 PM in response to Ben Adams1

my queries per second avg are very very low

Queries per second avg: 6.591
most other linux machines are at 20 with an i686

irrelevant, unless you're sure they're running the same level of traffic.

At first glance I'd say that for any two machines with QPS of 6.5 and 20, the machine with 20 has about 3 times as many clients requesting data.

In other words, the number of queries per second is based largely on the number of requests MySQL gets, not how long it takes to process them.

Now if you're saying that each server gets the same number of requests from the same number of clients, and that the Mac takes 3 times longer to process them, that's a different issue, but that is not a claim supported by the data at hand.

what is average for mac on queries per second?


Hmm, an iMac G3 running 10.0 on 128MB of RAM, or a dual 2.3GHz G5 with 16 GB of ram?
What size tables? how many client connections? What kind of queries? SELECT? INSERT? UPDATE?
What about the disk subsystem you're running on?
What database file format are you using? InnoDB? MyISAM?
In other words, too many variables to answer directly.

It really doesn't matter what other people are getting because environment is a major factor. I can tell you, for example, that most of my MySQL machines hum along at about 200-300 queries per second all day every day, and they're not busy - I specifically keep them well under capacity so that I can deal with traffic spikes - they peak around 2000 queries per second depending on what they're doing, By that measurement it blows your Linux machine out of the water, but that still doesn't mean anything since the environment is very different.

Aug 11, 2005 1:47 AM in response to Ben Adams1

Install Mysql Administrator, it has a nice pane called Health. I will recommend you to check status variables, it will get you valuable information.

I run mysql on my g5 with nice traffic - 70 concurrent connections. Here is my settings:

<code>
join buffersize 131072
key buffersize 67108864
query alloc_blocksize 8192
query cachelimit 4194304
query cachesize 2097152
query preallocsize 8192

</code>

Aug 11, 2005 1:12 PM in response to R.Cerny

I talked to a preformance guy at mysql he says its running great. but I still feel it is not fast.

I have MySQL Admin install it helped me work out some bugs.

database status:
| join buffersize | 16773120
key buffersize | 1073741824
query alloc_blocksize | 8192
| query cachelimit | 1048576
| query preallocsize | 8192

top load will jump from 2-3 to 11 at random times

Load Avg: 3.77, 5.86, 4.42 CPU usage: 11.1% user, 72.7% sys, 16.2% idle
SharedLibs: num = 148, resident = 22.5M code, 2.66M data, 12.8M LinkEdit
MemRegions: num = 29868, resident = 528M + 12.9M private, 59.7M shared
PhysMem: 384M wired, 434M active, 3.45G inactive, 4.25G used, 3.75G free

half our pages are php and half are perl, I'm currently convertion perl to php so its not running on two engines. I have been working on the database for about a month now....its none stop

when my threads get 20+ load is high and disconnects start happening

Aug 11, 2005 2:10 PM in response to Ben Adams1

Your load average is way too high, as is the System CPU time. Your machine shouldn't be spending 72% of its time in System, and a 5-minute load average of 5.86 is way high, too.

Since it's only spending 11% in user space I'm guessing you're not stressing the web server side of things, but something is amiss on your machine that's causing it to spend too much time on system tasks.

What other processes are consuming any significant time in top. What kind of disk setup are you running there (it might be disk access latency that's bogging you down).

Aug 11, 2005 2:21 PM in response to Camelot

iostat:
disk2 disk3 disk4 cpu
KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s us sy id
22.12 10 0.23 107.59 1 0.10 9.48 0 0.00 8 36 56

currently top is:
Load Avg: 1.73, 1.72, 2.56 CPU usage: 2.6% user, 7.7% sys, 89.8% idle
SharedLibs: num = 148, resident = 22.5M code, 2.91M data, 12.9M LinkEdit
MemRegions: num = 24645, resident = 454M + 9.89M private, 58.5M shared
PhysMem: 384M wired, 422M active, 3.40G inactive, 4.18G used, 3.82G free

it will jump like that back and forth from time to time
with MySQL Admin I don't like on part
under memory health
Key buffer usage is: 61.71 MB of 1GB
why isn't it using the full gig I gave it?

load is around 11+ why mysql threads are around 24 and now they are about 2-4

Aug 11, 2005 6:10 PM in response to Ben Adams1

That activity looks a lot better. It appears that something is spiking the load. It would be worthwhile tracking it down.

With regards to iostat you'll find it more useful if you add some numbers to the end. As it stands, iostat will give you the average over the machine's uptime, which isn't really relevant most of the time. Instead, add values to repeat the information periodically, for example iostat 5 would repeat the iostat display every 5 seconds, giving you a better feel for how much traffic is going on. Adding a second digit tells iostat to output that many samples, e.g. iostat 5 10 will output 10 lines, 5 seconds apart, and then quit.

Key buffer usage is: 61.71 MB of 1GB

why isn't it using the full gig I gave it?

How big is your database? MySQL is only going to use as much memory as needed to cache the active data. If your entire database is only 50MB then I wouldn't expect MySQL to use much more than that.

I'd only expect MySQL to use 1GB is when you have more than that amount of data active on the system.

Aug 12, 2005 8:08 AM in response to Camelot

The database size is around 2-3G.
its on ibp version 2.0.4
current posts : 1,323,086
current users: 10,284
average online is: 50-90

from what I see on top and the mysql threads is:
a mysql process will go through but the query will sleep for some time most only 10-20, but some will hit 200
| Id | User | Host | db | Command | Time | State | Info |
-------+------+-----------+--------+---------+------------
| 84674 | root | localhost | forums | Sleep | 293 | | |
| 84738 | root | localhost | forums | Sleep | 170 | | |
| 84753 | root | localhost | forums | Sleep | 130 | | |

PID COMMAND %CPU TIME #TH #PRTS #MREGS RPRVT RSHRD RSIZE VSIZE
13879 httpd 51.6% 25:40.30 1 12 182 4.65M+ 32.1M 15.3M- 80.4M+

USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
www 15928 95.4 -0.4 81300 9432 ?? S 10:14AM 0:22.37 /usr/sbin/httpd

The database and website, data are on an Xraid that is connected to an Xserver

Aug 12, 2005 10:51 AM in response to Ben Adams1

2-3GB for a discussion board data is a decent size, but MySQL is only going to cache recently-requested data, so it's entirely possible that 60MB is all that it needs (you can fit a lot of posts in 60MB), so I'm not at all worried about that.

So your problem is your web server.

Unless you're doing an extreme amount of traffic, httpd should not be using 95% of the cpu.

I have seen other reports of httpd consuming large amounts of CPU time, often related to the performance cache. It might be worth turning off the performance cache (as counter-intuitive as that might seem). Other than that, enabling apache's status module might give you some insight as to what it's doing.

Aug 12, 2005 6:11 PM in response to Ben Adams1

If the cpu load is caused by web traffic then the problem is the discussion board software you're using. It sounds horribly inefficient if it's taking that much CPU power to run a discussion board for 3,000 visitors/day - that's a significant number of users, but it isn't extreme.

I don't know the discussion board you're using, but it sounds like it needs some serious code optimization. It can take a lot of work to properly optimize a discussion board.

By comparison I run several boards much larger than that, and my cpu loads are in the teens. Mind you, I do run separate application and database servers, so they're not on the same hardware, but even so I think the code needs tweaking.

Aug 15, 2005 9:09 AM in response to Camelot

KeepAlive On
MaxKeepAliveRequests 500
KeepAliveTimeout 10

Yes the boards are coded very very badly.
currently;
Load Avg: 6.07, 6.41, 6.26 CPU usage: 3.4% user, 73.0% sys, 23.6% idle
SharedLibs: num = 148, resident = 23.2M code, 2.96M data, 12.9M LinkEdit
MemRegions: num = 36817, resident = 610M + 10.4M private, 63.6M shared
PhysMem: 386M wired, 580M active, 2.52G inactive, 3.46G used, 4.54G free

some httpd
29982 httpd 7.5% 2:35.57 1 12 182 3.87M 36.1M 11.4M+ 81.8M
29776 httpd 8.0% 2:00.42 1 12 182 3.55M 36.1M 10.3M 80.8M
29731 httpd 7.8% 2:14.60 1 12 181 3.52M 36.1M 9.66M+ 80.8M
29716 httpd 9.5% 2:23.61 1 12 181 3.84M 36.1M 10.2M+ 80.8M
29679 httpd 8.1% 2:15.88 1 12 182 3.92M+ 36.1M 10.8M+ 80.7M

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

mysql increase queries per second avg

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.