-
April 14th, 2003, 08:17 PM
#1
one and one = three?
Can someone explain this to me?
How can mysql use 44% CPU while the CPU is 98.8 percent idle? Okay, this is quite an extreme difference. I've been watching a small webserver (266mhz, FreeBSD 4.7) and there always seems to be a difference between the idle CPU cycles and the (combined) CPU cycles that all the processes use.
Code:
CPU states: 0.4% user, 0.0% nice, 0.0% system, 0.8% interrupt, 98.8% idle
Mem: 33M Active, 9712K Inact, 26M Wired, 5752K Cache, 17M Buf, 488K Free
Swap: 300M Total, 10M Used, 290M Free, 3% Inuse
PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND
149 mysql 2 0 34292K 7640K poll 22.3H 44.09% 44.09% mysqld
46560 www 2 0 5160K 4336K sbwait 0:09 1.32% 1.32% httpd
46561 www 2 0 5024K 4212K sbwait 0:05 0.78% 0.78% httpd
46565 www 2 0 5080K 4244K sbwait 0:07 0.73% 0.73% httpd
I wish to express my gratitude to the people of Italy. Thank you for inventing pizza.
-
April 14th, 2003, 08:43 PM
#2
are you sure that it isn't a different sector of the drive that it is on about
-
April 14th, 2003, 08:48 PM
#3
I wish to express my gratitude to the people of Italy. Thank you for inventing pizza.
-
April 14th, 2003, 08:50 PM
#4
Guus,
I found this from a defunct page (url was www.tchpc.tcd.ie/support/Training/User_Course/ process-management-tools.html ; accessed via Google )
The percentages given are "user", which means the time the CPU spends running userland programs, "system" which is the time spent doing kernel tasks, "nice" which is the time spent doing tasks with a nice value of less than 0, and idle time.
"niced" tasks have to execute at some stage in either user or kernel space, so therefore the overall total you see will be more than 100% if there are many niced programs running.
It's the user CPU you're seeing the 44%, not overall. So that would mean for that user, MySQL is taking 44% of what the user is using, which may be .01% of the system as a whole. Does that make sense?
-
April 14th, 2003, 08:53 PM
#5
Nah, it cannot be that simple, there must be some chaos math application going on here. I just have to remember which one. . .it's gotta be that 100-44=98.8 ya there ya go, solved it mathematically.
-
April 14th, 2003, 08:56 PM
#6
Yes it does.
So, in my example above, both mysql and www (the three pid's combined) could each reach 100% (in theory at least) without using 100% of my actual, 'irl' CPU cycles?
The3ntropy: You evil genius! You solved it! *cough*smartass*cough*
I wish to express my gratitude to the people of Italy. Thank you for inventing pizza.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|