[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Does sar -x actually work?



Greetings.

We have a cluster of machines which is used by several unrelated research
groups for performing calculations.  Sometimes individual users or groups
will get a little out of hand and soak up more than their fair share of
the CPU's, so we'd like a way to take an accounting of who is using how
much of the system.

Well, sadc and sar seem like the obvious tools for this, and I read in
their manpages that the -x PID option should allow us to collect and
report statistics on individual processes, which we could then add up
for each user.  But my experiments don't bear that out.

'sar -x PID' reading from the default file on my desktop (woody) just
complains "Requested activities not available in file".  So next I tried
'sadc -x PID' for each of several processes running on the machine,
saved the output for each process to a separate file, and read those
files with sar.  When I do that, CPU usage information appears to
reflect the state of the system, not the amount of CPU used by each
process; for example, say PID 3000 is 'dd if=/dev/zero of=/dev/null',
while PID 3001 is a shell left idle for several minutes; sar's output
shows similar (though not quite identical) CPU usage when reading from
files generated with 'sadc -x 3000' and 'sadc -x 3001'.

So, is sar broken or am I?

If sar is broken, can anyone suggest a good way to get accurate per-UID
CPU usage accounting?  Seems like it should be a solved problem; if all
else fails we could roll our own perl script that runs ps and adds up
numbers, but we'd prefer to use a known-workable solution if one is
available.

Thanks,
-mrj
-- 
# Michael Jinks, IB # JFI/MRSEC/EFI Computing # University of Chicago #
      Reader!  Think not that
      technical information
      ought not be called speech;  -- Anonymous, "How to decrypt a DVD"



Reply to: