1745782 Members
3450 Online
108722 Solutions
New Discussion юеВ

Check process

 
Intothenewworld
Advisor

Check process


I would like to find the server process which use high CPU ( ie. run over 10 hours and use 90 % CPU time ) and then kill such process , can advise how to write such script ?

Thanks.

4 REPLIES 4
Dennis Handly
Acclaimed Contributor

Re: Check process

Intothenewworld
Advisor

Re: Check process

thx reply ,

I tried it in my unix-like system ( eg. Redhat ), the output is a list of processes ( as below ) , these processes do not use 90% CPU , can advise how to use the script ? what I need to chang if run it at linux server ?

Thanks.

 

 

10021 0
10043 0
10143 0
10144 0
10697 0
11818 0
12682 0
12683 0
12710 0
12825 0
14029 0
14207 0
14212 0
14213 0
14214 0
14310 0
14311 0

Dennis Handly
Acclaimed Contributor

Re: Check process

>I tried it in my Unix-like system (eg. Redhat)

 

(This is a HP-UX category and that script is meant to work on a UNIX branded OS.  If you want Linux answers post in a Linux category.  If you want, we can ask this topic to be moved.)

 

>the output is a list of processes (as below) , these processes do not use 90% CPU, can advise how to use the script?

 

That was a debugging line that I should have left commented.  I've updated that post.

 

>what I need to change if run it at Linux server?

 

Lower that 90 and see if you pick up some PIDs?

James R. Ferguson
Acclaimed Contributor

Re: Check process


@Intothenewworld wrote:

I tried it in my unix-like system ( eg. Redhat ), the output is a list of processes ( as below ) , these processes do not use 90% CPU , can advise how to use the script ? what I need to chang if run it at linux server ?


Look at your Red Hat manpages for 'ps'; look at the thread Dennis suggested as a "starter"; and TRY to construct your own solution.  Then, if/when you are stuck ask for help.  You cannot expect every Unix variant (e.g. HP-UX, AIX, Solaris, Mac OS X) to have exactly the same semantics and syntax.  The GNU toolsets which comprise the various Linux distributions are generally far richer in features.  Learn to fish and you will never go hungry.

 

...JRF...

 

...JRF...