Previous Thread
Next Thread
Print Thread
Rate Thread
#267022 01/16/2004 12:59 PM
Joined: May 2003
Posts: 94
Power User
Power User
Offline
Joined: May 2003
Posts: 94
We just recently upgraded to 6.4 and Im now being told we're using a heck of a lot of cpu. How 'normal' are these numbers and what can be done to scale back this cpu hit like this?

last pid: 65592; load averages: 0.42, 0.37, 0.33 up 23+15:53:37 06:31:58
63 processes: 3 running, 60 sleeping
CPU states: 53.9% user, 0.0% nice, 36.0% system, 0.0% interrupt, 10.1% idle
Mem: 50M Active, 496M Inact, 137M Wired, 48K Cache, 112M Buf, 319M Free
Swap: 2032M Total, 2032M Free
PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND
38076 mysql 45 0 19064K 15200K RUN 405:00 49.80% 49.80% mysqld


At the time, I had
There are 72 registered and 18 anonymous users online.
With on line settings set to 30 minutes. I have since scaled that back to 10 minutes.

Input is sorely needed, we can NOT afford a dedicated server here.

Sponsored Links
Joined: Sep 2003
Posts: 803
Coder
Coder
Offline
Joined: Sep 2003
Posts: 803
I am totally guessing here but did you check to use "persistant connections"? I was told one time that it could lead to problems on some larger boards...

Joined: Oct 2000
Posts: 2,223
Veteran
Veteran
Offline
Joined: Oct 2000
Posts: 2,223
BSD box. 63 processes, only 3 running. Load is under one, which means that over the last few minutes you had almost no processes that had to wait in queue. Your not using much memory to speak of.

It does look like your mysql is maybe using a bit more CPU than you would like, but that top snippet shows us nothing really.

Next time you run into this we'll need more than what you've shown. All that says is that mysql is using a lot of process. Doesn't say who is using mysql or what they are using it for. Doesn't help us troubleshoot.

Here's what will. -

Next time this happens have them log into mysql and run the following

show processlist;

Then post the entire processlist as it appears. That will show which query is slow, who is running it, and what kind of connections you have. We can go from there, it'll help a lot.

It would also help a lot if you posted a link to the site so we can take a look at your settings, useage patters, etc.


Picture perfect penmanship here.
Joined: May 2003
Posts: 94
Power User
Power User
Offline
Joined: May 2003
Posts: 94
DrChaos , persistant connections are off. We're not using them.


[]navaho said:
BSD box. 63 processes, only 3 running. Load is under one, which means that over the last few minutes you had almost no processes that had to wait in queue. Your not using much memory to speak of.

It does look like your mysql is maybe using a bit more CPU than you would like, but that top snippet shows us nothing really.

Next time you run into this we'll need more than what you've shown. All that says is that mysql is using a lot of process. Doesn't say who is using mysql or what they are using it for. Doesn't help us troubleshoot.

Here's what will. -

Next time this happens have them log into mysql and run the following

show processlist;

Then post the entire processlist as it appears. That will show which query is slow, who is running it, and what kind of connections you have. We can go from there, it'll help a lot.

It would also help a lot if you posted a link to the site so we can take a look at your settings, useage patters, etc. [/]

Im not very familiar with using commands in mysql, I merely type : [:"red"]show processlist; [/] as it appears in red ?

Joined: May 2003
Posts: 94
Power User
Power User
Offline
Joined: May 2003
Posts: 94
ysql> show processlist ;
+-------+--------+--------------------------------+---------+
| Id | User | Host | db | Command | Time | State | Info |
+-------+--------+--------------------------------+---------+
| 87665 | admin | localhost | rebuild | Query | 0 | NULL | show processlist |
| 87722 | dbuser | hosting23.digitalprinceton.net | rebuild | Query | 0 | Sorting result |
SELECT B_Number
FROM w3t_Posts
WHERE B_Topic = 1
AND B_Board |
| 87723 | dbuser | hosting23.digitalprinceton.net | rebuild | Query | 0 | Sorting result |
SELECT B_Number
FROM w3t_Posts
WHERE B_Topic = 1
AND B_Board |
+-------+--------+--------------------------------+---------+

Sponsored Links
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
There are only two executed queries, which should not be the problem.

You should run this command when you're experiencing problems with the server (high cpu usage). The processlist should be a lot longer then.

Joined: May 2003
Posts: 94
Power User
Power User
Offline
Joined: May 2003
Posts: 94
Ok, 47 users on line tonight. Forum goes down.

I did show processlist; and got two items.

One command shows 'sleep' the other is query.

?? What to think! I have no idea !

Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
Mhh, that doesn't sound bad. No query is locked and the mysql server shouldn't be busy with two queries at the same time.

Joined: Feb 2005
Posts: 1
Lurker
Lurker
Offline
Joined: Feb 2005
Posts: 1
I found this thread searching for "high CPU MySQL" and discovered that all the threads about this had to do with FreeBSD. We were having exactly the same problem, and had optimized our tables, dropped our full-text indexes, researched all our queries and everything else, and even with no slow queries, and few processes running, we were at 98% CPU usage.

Eventually I found two key links, and the solution:

http://dev.mysql.com/doc/mysql/en/freebsd.html

and

http://jeremy.zawodny.com/blog/archives/000697.html

The solution: update FreeBSD to Release 5, or re-compile MySQL with WITH_LINUXTHREADS=yes

This appears to have solved the problem for us.

Tac


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,574
Posts293,926
Members13,850
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)