The UNIX Forums
"Join the Network of UNIX System Users"


 
Subject: ps report (on tru64)
iPod
Newbie
Rank: 1



UID 188
Digest Posts 0
Credits 0
Posts 15
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 5, 2007 12:56 AM  Profile | P.M. 
ps report (on tru64)



ps report (on tru64)



hi,
i have 10 processes running on a tru64
machine with 16 cpu. when i am checking the states of these processes
with ps command, i saw that almost never more than 3 of them are in the
r(unning) state. (generally they are in the s(leeping) state).

although there are many other processes running on the same machine,

my expectation is to see most of my processes in the running state,
because top reports generally we have 20%-50% idle cpu,

even if they are waiting for some resource (e.g: io), they should be
in u(ninterruptable) state, am i wrong?

how can this sleeping state problem can be explained?


Top
JMonster
Newbie
Rank: 1



UID 205
Digest Posts 0
Credits 0
Posts 40
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 5, 2007 12:56 AM  Profile | P.M. 
if a process is waiting for a resource it will almost always be asleep and will be woken by the kernel when the resource is available. cpu's do not simply run processes...it might be running kernel code to make those needed resources available. an idle cpu is looping repeatedly scanning the run queue looking for something to do... no other state is counted as idle.

the exception to sleeping for a resource is spinlocking...just looping until the resource is free (because the resource is expected to be locked very briefly). this happens in the kernel in an smp environment. 16 cpus is a lot and you probably spend a fair amount of time spinlocked. spinlocking if why you can't have unlimited numbers of cpu's on an smp box...you reach a point where you spinlock too much.
Top
Ithilnet
Newbie
Rank: 1



UID 190
Digest Posts 0
Credits 0
Posts 11
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 5, 2007 12:56 AM  Profile | P.M. 
s(leeping) state means that process is waiting for a resource.
then, is it possible to determine what is that resource?
process is waiting for what?
using lsof, iostat,netstat,vmstat or something else on tru64?
Top
erogers
Newbie
Rank: 1



UID 137
Digest Posts 0
Credits 0
Posts 16
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 5, 2007 12:57 AM  Profile | P.M. 
well, i have never used tru64, so i'm not sure how hard that will be. but at some level the answer is yes, it is possible. a sleeping process will have a value usually called a "wait channel" that relates to what it is waiting for. ps often can display this field labelled "wchan" or something like that. it is a address in the kernel's memory space. sometimes you can figure it out with adb. some recent bsd versions actually decode this field. hp has a product called glance that can decode it for hp-ux. i know that hp has a version of glance for solaris. i don't know if they have one for tru64 or not. if they do, it is worth getting. it is the best performance tool i have seen.
Top
 

 

All times are GMT, the time now is Jul 31, 2010 03:38 AM

Powered by Discuz! 5.0.0  © 2001-2006 UNIX Forums
Processed in 0.005224 second(s), 8 queries

Clear Cookies - Contact Us - UNIX Help - Archiver - WAP