Subject: Re: Slow output from 'ps'
To: Greg A. Woods <>
From: Chris G Demetriou <>
List: current-users
Date: 06/29/1995 23:56:02
> I have an average of 61 processes running, but ktrace shows that ps goes
> out to /dev/drum for 0x1000 bytes of data about 112 times.

process argument lists, and the machinations necessary to retrieve

> pstat -s reports:
> Device      512-blocks     Used    Avail Capacity  Type
> /dev/sd0b       121496    63208    58288    52%    Interleaved
> My guess is that reading /dev/drum on a busy single spindle system costs
> an awful lot of wall-clock time.

probably.  unless i'm mistaken (i've not looked at the libkvm code in
a while, though), the kvm routines only go out to the swap device if
they needs to (i.e. they normally pull things from /dev/mem).

That would indicate that most of the arg lists that ps is digging up
really do need to be read from swap (if they're going to be read at
all), so, no matter how you do it, you're going to end up hitting the
swap device a fair amount.

As people have discovered, process arguments can be 'hard to come by.'
I've seen "ps auxc" cut down the 'ps' wall-clock time by a factor of 7
(from "ps auxwwe", when the ps binary is in the cache).