1819778 Members
3512 Online
109607 Solutions
New Discussion юеВ

Re: Run away process/es

 
Ricky B. Nino
Frequent Advisor

Run away process/es

Hi,

What command can I issue to identify those run away (inactive) process/es in my system (HP-UX 11.0)?

Thanks...
Opportunities expand for people willing to put time and effort into learning new skills.
12 REPLIES 12
U.SivaKumar_2
Honored Contributor

Re: Run away process/es

Hi,

#top

will give status of processes by R- running
S- sleeping Z- zombie.


Also

#ps -ef | grep defunct

will show zombie processes.

regards,

U.SivaKumar
Innovations are made when conventions are broken
Kevin Wright
Honored Contributor

Re: Run away process/es

Run away processes are generally processes that are taking up all of the CPU, and need to be killed off. Use kill before issuing a kill -9 as last resort.
top

Defuct processes are dead, and should not be taking up any cpu cycles. you cannot kill these off (they are dead)without a reboot as they are not waiting for the kill signal anymore.
ps -ef |grep defunt
Ricky B. Nino
Frequent Advisor

Re: Run away process/es

Hi U.SivaKumar,

#top is good. Any other workaround?

Hi Kevin,
Thanks for a very specific definition.

What I intend to do here is to create a script that will run in a given time and will check run away process/es and will automatically kill it. That's why I am looking for a other possible workaround aside from the command 'top'.


Opportunities expand for people willing to put time and effort into learning new skills.
Michael Tully
Honored Contributor

Re: Run away process/es

Because 'defunct' processes are already dead, you may not be able to kill them at all.

Your could try:

# ps -ef | grep defunct | awk '{print $2}' | xargs kill -9
Anyone for a Mutiny ?
U.SivaKumar_2
Honored Contributor

Re: Run away process/es

hi,

#ps -aux

will show processes with CPU utilisation field in linux.

No sure whether it gives CPU utilisation field in HP-UX 11.0 . try it.

regards,
U.SivaKumar
Innovations are made when conventions are broken
Scott Van Kalken
Esteemed Contributor

Re: Run away process/es

If you look for the parent of the defunct process, you can get rid of them.

Don't kill the parent by any means, it might just mean restarting your application (or just killing the parent).

We get this with oracle some times. It's got more to do with concurrent managers than oracle itself.

We just restart the concurrent managers and your defunct processes go away.

As I said though, look for the parent id of the defunct ones.

As for high CPU utilization, I'm trying to figure that out at the moment myself.

Sometimes you get high CPU utilization but it's because someone is doing something, doesn't necessarily mean it's dead. It may or may not have a tty associated with it. If anyone has ideas, let me know.

Scott.
Ricky B. Nino
Frequent Advisor

Re: Run away process/es

Hi Scott,

As per my readings...

Processes with high CPU utilization AND PPID=1 is considered run-away process. This applies to processes invoke other that the 'root' account.
Opportunities expand for people willing to put time and effort into learning new skills.
Ricky B. Nino
Frequent Advisor

Re: Run away process/es

Hi Scott,

As per my readings...

Processes with high CPU utilization AND PPID=1 is considered run-away process. This applies to processes invoke other that the 'root' account.
Opportunities expand for people willing to put time and effort into learning new skills.
Steven Gillard_2
Honored Contributor

Re: Run away process/es

Ricky,

Your last statement isn't strictly true either - lots of daemon processes don't run as root but have a ppid of 1, and as Scott points out they could potentially be using a large amount of CPU doing valid work. It could be a dangerous thing to write a script that automatically kills these processes!

Any process that has been using 100% of one CPU for a period of time longer than a few minutes could be considered 'suspect', but thats about it. I suggest your script simply notify you so you can investigate and manually kill the process if necessary.

Regards,
Steve
Byron Myers
Trusted Contributor

Re: Run away process/es

Ricky, in general a process with ppid=1 does NOT indicate a runaway process - regardless of its CPU utilization. However, you may have a specific application where this may be true. A ppid=1 just means that the parent process that kicked of that program is no longer running, so the init daemon assumes the role as the parent. Example, a script with "sleep 500" as its only line. run this in background from a shell, then exit the shell. The original parent of the script was the shell, but because the shell is no longer running the init daemon (process ID=1) is now the parent of your sleep script.
If you can focus your eyes far and straight enough ahead of yourself, you can see the back of your head.
Ricky B. Nino
Frequent Advisor

Re: Run away process/es

Hi Steven/Byron,

Thanks for the clarrifications... I guess i just stick with top and/or glance plus in manually monitoring my systems run-away process/es.

Regards...
Opportunities expand for people willing to put time and effort into learning new skills.
Chris Wilshaw
Honored Contributor

Re: Run away process/es

You could try

UNIX95= ps -eopid,ppid,pcpu,etime,vsz,args

This give the PID, parent PID, current percent cpu used, elapsed cpu time, memory size and command details for all processes on the system.

you can then use sort to order this by any of the columns that you want to

eg:

UNIX95= ps -eopid,ppid,pcpu,etime,vsz,args | sort -rnk 3

sorts based on %cpu.