1837930 Members
4243 Online
110124 Solutions
New Discussion

CPU consumption

 
Prashun Gupta
Advisor

CPU consumption

All,
I have a application which is consuming 98-99% of cpu timings. Can anyone suggest the possible reasons for that, and the remedies of them.
Thanks
Prashun
7 REPLIES 7
Pedro Sousa
Honored Contributor

Re: CPU consumption

Prashun, could you post some more information? like:
- what's the application
- is it a process?
- some particular user?
- syslog messages?

generally: maybe restarting the app will solve it.
John Bolene
Honored Contributor

Re: CPU consumption

Reasons are:
it needs the cpu time (I run SETI processing which takes all of one processor)

it is in a loop somewhere (bad programming)
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
Prashun Gupta
Advisor

Re: CPU consumption

Infinite loop possibility I am searching, can anybody suggest some method to detect that in code.
I have tried to put a time stamp,
Any other thing if you can tell
Prashun
MANOJ SRIVASTAVA
Honored Contributor

Re: CPU consumption

Hi Prashun

Do sar 2 10 and get the averages from there , where it shows the % of utilization in terms of or usr,sys,and i/o. Then if you have any indicators go from there and try with top , glance to know which processes are eating the CPU.

Manoj
Dave Wherry
Esteemed Contributor

Re: CPU consumption

Is there anything else running when this process runs? If it is not getting interupted by any other processes then it will just consume what ever is available. If it is hurting the performance of other processes when it runs then you have a problem.
Prashun Gupta
Advisor

Re: CPU consumption

Hey Dave
Can you elaborate a little bit more
Prashun
James R. Ferguson
Acclaimed Contributor

Re: CPU consumption

Hi Prashun:

Dave is absolutely correct. A single process with few interrupts (like waiting on an I/O to complete) can consume 100% of a processor, particularly in the absence of any competing processes.

There is not necessarily anything wrong with the code in a case like this.

More important than a percentage of the CPU consumed is the load average on your system. Use 'uptime' to see these values and/or use 'glance'. High load values (run queue depths) indicate contention for a processor (CPU). High CPU utilization alone may not be significant at all.

...JRF...