LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   time yielding CPU% > 100 (https://www.linuxquestions.org/questions/programming-9/time-yielding-cpu-100-a-484680/)

arg3t3k.senvx 09-18-2006 11:57 AM

time yielding CPU% > 100
 
Has anyone experienced this before?

paulsm4 09-18-2006 12:02 PM

yes
 
Yes.......

arg3t3k.senvx 09-18-2006 12:30 PM

=)

Thanks for replying...

Would you have any ideas as to why / how this is happening?

soggycornflake 09-18-2006 01:04 PM

Is this an smp/dual-core box?

The cpu % is reported in terms of clock ticks (see man 2 times), obviously multiple cpus can do more work in a given amount of time...

e.g. if a process takes 5 seconds, consisting of 2 cpus which each use 3 seconds of cpu time (simultaneously of course), the other 2 seconds presumably being i/o, then you have (3+3)/5 = 120% cpu. Or something like that.

paulsm4 09-18-2006 01:32 PM

Hi, arg3t3k.senvx

1. Your original post really didn't have enough information to even begin to guess where
"the problem" might be, or what you could possibly do about it.

Please check out this link - I think it'll help:
"How To Ask Questions The Smart Way" by Eric Steven Raymond and Rick Moen.
http://www.catb.org/~esr/faqs/smart-questions.html

2. As far as "getting more information", I'd start out with the program "top:

a) Start a command line session
<= DO THIS FIRST
b) Try to reproduce the problem (do whatever "makes the CPU go to 100%")
<= THE SYSTEM WILL PROBABLY SLOW TO A CRAWL
c) Type "top"
<= THIS WILL GIVE YOU A SUMMARY OF ALL PROCESSES RUNNING ON YOUR SYSTEM
d) Type "F" (to sort by column number), then select "%CPU"
e) Whatever process at the top might be showing "99% CPU" and, if so, is probably "the bad guy"

3. Post whatever additional information you find back to us here on LQ. We might be able to help.

Good luck .. PSM

arg3t3k.senvx 09-21-2006 07:11 AM

Spot-on, soggycornflake. Yes it's dual core indeed. Thanks!

Summary of how CPU% is calculated by GNU time:

CPU% = ( noOfCPUSecsInUsrMode + noOfCPUSecsInSysMode ) /
ElapasedRealTime

As I understand,

The noOfCPUSecsInXXXMode includes CPU seconds for all
processors that this process and / or its ( waited for )
children got allocated to.


Hi PSM,

Another great read from Eric Raymmond, and surely worth it.

I knew "the bad guy", but was looking for a rather general
*howIsItPossible* answer. Soggycornflake has providied a
perspective adjustment that I much needed, for my past
experience has solely been on 1-way, single-core machines.

Thank you for your time!


~ argetek

paulsm4 09-21-2006 09:55 AM

Hi, arg3t3k.senvx -

If you're going to ask a question, you should really include all pertinant information. It's the courteous thing to do ;-)

Otherwise, we're just "shooting in the dark", taking guesses.

And, IMHO, "shooting in the dark" is Bad. Sometimes necessary. But it never, ever "feels right".

So in the future, please give a few specifics about what you tried (for example, did you run "top" or "ps -eaf" to identify the process?) and what you're trying to figure out (why the process CPU time seems so excessively high, yet that process doesn't *seem* to be misbehaving, and the system doesn't *seem* to be under any stress). You might also want to cut/paste a few lines from your "top" or "ps" output.

Anyway - glad you figured out the problem.

Your .. PSM

arg3t3k.senvx 09-21-2006 01:25 PM

Cool it, dude.

All of this:

So in the future, please give a few specifics about what you tried (for example, did you run "top" or "ps -eaf" to identify the process?) and what you're trying to figure out (why the process CPU time seems so excessively high, yet that process doesn't *seem* to be misbehaving, and the system doesn't *seem* to be under any stress). You might also want to cut/paste a few lines from your "top" or "ps" output.

was totally unnecessary, since anybody smart enough to be on this thread
can figure out:

When someone writes something like "time yielding CPU% > 100" MEANS he is
running the SAME process EXPLICITLY passed to time!

So why the heck did I need to run "top" or "ps -eaf"???

I agree with some of your thinking but it simply doesn't make
sense in all cases; convince 'em on logic and they'll be all
1's under your boolean influence.

Had you been saying something about the machine specs, that would
have made sense in retrospect. AND I would have agreed to that
because that's something admittedly my past experience obfuscated.
But even after seeing my post, I am not very thrilled about
this insistence on something that doesn't make sense.

I am a contributor elsewhere, so I respect your efforts here...
but beating around the bush on a generalization can tend to be
offensive.


All times are GMT -5. The time now is 01:23 PM.