Operating System - HP-UX
1833146 Members
3423 Online
110051 Solutions
New Discussion

Re: process occupying 97% of cpu

 
SOLVED
Go to solution
aruns_s
Frequent Advisor

process occupying 97% of cpu

I have a process started log back and it is taking more that 96.7% of cpu.I f give ps- ef
it is showing as -sh invoked by root.Is there any way to find out what is the command used by that process.

regards
Arun
7 REPLIES 7
Adisuria Wangsadinata_1
Honored Contributor
Solution

Re: process occupying 97% of cpu

Hi Arun,

Using 'top' command to check the process that use the CPU.

# top [enter]

Hope this information can help.

Cheers,
AW
now working, next not working ... that's unix
aruns_s
Frequent Advisor

Re: process occupying 97% of cpu

hi
as per top, cpu usage is 97%.
please advice how can I solve this.
I am not sure if I can kill the process.Any other way to find out what is the command used by that process.
Adisuria Wangsadinata_1
Honored Contributor

Re: process occupying 97% of cpu

Hi Arun,

On the 'top' command, check the command that using lot of the CPU source.

Example :

CPU TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU COMMAND
0 ? 36 root 152 20 8032K 8032K run 29:04 0.33 0.33 vxfsd
0 ? 2591 root 152 20 252M 58804K run 67:39 0.31 0.30 prm3d
1 ? 3890 root 152 20 15424K 4036K run 1:44 0.18 0.18 rep_serv
1 ? 3891 root 152 20 12856K 2364K run 1:20 0.18 0.18 agdbserv

On the example above, the command that using most of CPU source is vxsfd.

Some of the issue about taken CPU source can be solved by patches. Please let me know which process on your system.

Hope this information can help you.

Cheers,
AW
now working, next not working ... that's unix
Devender Khatana
Honored Contributor

Re: process occupying 97% of cpu

Hi Arun,

I also happended to find one such process some time back in my server, I was also confused about it and finally rebooted the server and it went away.

In my opinion it is a process linked to some session which has got terminated. Killing the process shall finish it but try to do it when nothing (applications) are running if possible. Otherwise reboot will clear it.

HTH,
Devender
Impossible itself mentions "I m possible"
aruns_s
Frequent Advisor

Re: process occupying 97% of cpu

Hi
Thaks for youe advice
I found that 'sh' is the process which is taking 97% cpu.and it is in run stage.This process had started on dec 20.please let me know whether I can kill.

regards
Arun
Rory R Hammond
Trusted Contributor

Re: process occupying 97% of cpu

Most likely a looper and probably not doing any useful work.

you should walk the process tree to make sure it not running other process before you kill it

nat 26871 26676 0 Jan 3 pts/ti 0:46 /opt/cognos/ph823d7/bin/quick cc=
nat 26676 26674 0 Jan 3 pts/ti 0:00 -sh
root 26674 1809 0 Jan 3 pts/ti 0:00 telnetd -b /etc/issue
root 1809 1 0 Sep 22 ? 8:17 /usr/sbin/inetd
root 1 0 0 Sep 22 ? 73:56 init

In this example -sh (pid 26676) has a child 26871. You want to make sure the children are not important process. But if it is the -sh taking the time, probably a looper.

In the above example, If you kill -sh (pid 26676) make sure the child also dies

Based on the date you mentioned, and the fact -sh is taking the cpu time, I would kill your "offending" process.
kill -1 first to see if it will die nicely
it probably will not die. than use the more agressive signals.

rory



Rory
There are a 100 ways to do things and 97 of them are right
Clifford Chi
Advisor

Re: process occupying 97% of cpu

Hi Arun,

Use "top" command to identify which process is consuming high CPU resource.

Understand you have identified "-sh" process is the culprit. The next thing that you need to do now is to find out what are the children processes that might be still running. Use the following commands to capture the process table:

# export UNIX95=XPG4
# script /tmp/processes.txt
# ps -e -H -o ruser,vsz,sz,pcpu,pid,ppid,state,comm,args
# exit
# more /tmp/processes.txt

After search for the process id of "-sh" from the file "/tmp/processes.txt" (a process hierarchy). Each process is displayed under its parent. Trace the children processes first and kill them if necessary.