1847095 Members
6009 Online
110262 Solutions
New Discussion

Re: ps options.

 
joe_91
Super Advisor

ps options.

Hi All:

I am using the foll. command to observe my production server.
UNIX95 =ps -eo ruser,pid,args,wchan|sort -rn
to find out the the process with highest memory utilization and also what it is waiting for(wchan). Now the last column has an entry like 840c48. what would that mean?we are having problems with occasional runaway process from the appln. what would be the best way to clean this up. Any suggestions are welcome including some scripts to clean up runaway process.

Thanks
Joe.
5 REPLIES 5
Jeff Schussele
Honored Contributor

Re: ps options.

Hi joe,

That value is the address of an event for which the process is sleeping - i.e. the wchan output.
If it's an "-", it's running.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Jeff Schussele
Honored Contributor

Re: ps options.

Hi (again) joe,

A better option would be to use the std HP-UX ps as follows:

ps -ae | sort -rn -k 3,3

This sorts, descending, on the 3rd field of the ps -ae output - which is the minutes value of the time field. The cumulative execution time of the process. This should result in the CPU time hogs at the top.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
harry d brown jr
Honored Contributor

Re: ps options.

Joe,

You are better off getting glance/measureware (buy from HP - but there is a limited trial version - 30 days) to watch your system processes, plus "lsof" doesn't hurt (free):

http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.61/

live free or die
harry
Live Free or Die
joe_91
Super Advisor

Re: ps options.

Hi:

I have lsof. How do i use it for this problem? Please advise.

Thanks
Joe.
Jeff Schussele
Honored Contributor

Re: ps options.

OK one last time....I forgot you want what it's waiting on...although it only gives you an address. Try this

UNIX95= ps -eo time,ruser,pid,args,wchan | sort -rn -k 1,1

This will put time in the first field & sort descending on it - time hogs up top.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!