[MLton-devel] CPU utilization

Henry Cejtin henry@sourcelight.com
Thu, 3 Jul 2003 15:06:28 -0500


A  tapeworm  is  just  a  term  I  coined long ago for a process that is just
sitting there, using all the CPU it can get but not doing any  thing  useful.
Netscape,  for  instance, had bugs where it would do this.  You would look at
ps and see that it had racked up a bazillion hours of CPU time.   The  result
is  that  the machine feels about 1/2 the speed it actually is.  Actually the
effect is slightly less bad than that because a new process is  given  a  bit
more of the CPU then an old grinding process.

How  far apart were the process ids?  That is a rough estimate of the rate of
process creation.  You should look in /var/log/messages for a line like
    init: Id "??" respawning too fast
That would be if the processes were being started by init.  In that case they
would  be  shut  off  after  a  bunch exit quickly for 5 minutes, and then it
starts it again for another burst.  I rather doubt  that  that  is  the  case
since usually the load stays pretty low then because of init shutting it down
for a while.

As to finding who is spawning off the processes, you could try just  doing  a
bunch of
    ps aux -w -w -w --forest
rapidly to a file until you catch it.  Then it will show you the parent, etc.
This can be fooled because a process whose parent exits has its parent set to
pid 1.

Alternatively,  if the parent that is doing the forks is sticking around then
you can look at its child user and sys times (cutime  and  cstime).   When  a
child process exits, the parent has its final user and sys times added to its
cutime and cstime fields.  My script z.stat, given a pid will print  out  all
the information in the /proc/???/stat file, which includes that.

begin 644 z.stat.tgz
M'XL(`+F,!#\"`^V5[5/:,!C`^Y7^%9')B8>3MKPX3_V@#)`;`P9%O:D?:DDA
M4-I>4GR;_.]+"TE=F]NW;7>[_#Z`_>7)D^<)27T])*$5*G\43=>THUI-T2A5
M0XN_]6HU_J94:EI=T>I']4K=T*LU.J[K%<U0@*;\!5:T?PR`,H,>?OEM',1$
M^>_XL%-^0%Z9S%35\3%`8.*K.=L*03G`OEW>1>7H?*@3WX/@3;6>%F#OHMGN
M],`/->>`,Z"IN?`E@+=.J71/'_,!FN13RO:7R[2+DL*T#`23@RD.,I,A(<CW
MTCH,7S(JF&93.JXU)6FY1)[CAIG2Q7IIS87!0KT*T1)F^Q=(6QAJBV/]E1="
MG-DNC'R,!!M!4_BK3&THQ-!R'RUW):C0PJ%HY4>"7C,2D\R.8A<MA4EM?Y*9
M#[V)2,?Q],->I$<6)%Q`$@@URIX8-/4L-VT?7-]>P(D@F(;[&`H&Z,VP9VG_
M9,^LZ#32\5L]-J-.^W(\V"J#J4[/W*H*4]_&'>:J/*S;W:H:4^;PG&6K\[`^
MFWG$U,5XM%6?F&H-FEMUS-279`%=8W(\&NI,\AY&S?85D\:[2(-)WL>@P]?1
M>2/GW>%7)I-6FHGDA3<NNY^9Y*4W^GR_=%[\R.SS?>7%FR.32UZ\:79Z3!J)
M[(^9Y,6/AVWF>.TWC0$/Y+7?M$;?F>2_PY7YKD^#MS08]EM,\I:N.[W&);/'
MR2_)C@7O:'`]S*MKE;YDZ8WV0@?D>RU0F!P`AW[>>?D#T&O1!_H.IB_M(J*S
M]!/Z\CX]H_X$E$IH/WI!YUSK`;IT,#ZN"'P$^CVUR`'%[4AR-\#;&T@DNQJ_
MVN1F9/SF8FQ6Y347=)W04N/`R!-:RBZ*_HK+GD?_/T[`'.R<@8H6E3W?)HA+
M)*``C/WXD6<$A2AAM%?S4MS+)BD=+)+R)GBM\ODTK[9)P.<7M>?",S@]I0L"
M^!QB:S_*][[HN^@JY]8`N@2FFZ'+QYL?=W00][)6UWNJ(I%()!*)1"*12"02
:B40BD4@D$HE$(I%()!+)/^4G)M3!7P`H````
`
end



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel