About the 'TIME' header of the 'ps' command

About the 'TIME' header of the 'ps' command

Post by Ga?l Trinquar » Wed, 15 Sep 1999 04:00:00



Say I have TIME=00:20, does it mean the process consumed as much CPU as if
it was running with 100% of the CPU during 20 seconds ?
 
 
 

About the 'TIME' header of the 'ps' command

Post by Richard L. Hamilt » Thu, 16 Sep 1999 04:00:00


[Posted and mailed]

100% of _one_ CPU actually, on a multiprocessor system.

That is, if I run the distributed.net client (which
is multithreaded and sucks up all of ALL the CPUs, but
at a low priority so as not to compete with anything else)
on a two CPU system where nothing else is going on, I could
see something like the following:

$ ps -p 498;sleep 10;ps -p498
   PID TTY      TIME CMD
   498 ?       10821:47 rc5des
   PID TTY      TIME CMD
   498 ?       10822:07 rc5des

Note that it used 20 seconds of CPU time (that is, 10
seconds times two CPUs) in 10 seconds of clock time.

Another implication is that 1 second of CPU time on
a system with a fast CPU gets more done than 1 second
of CPU time on a system with a slower CPU.  That could
get interesting if one were billing based on CPU time
across multiple, different speed systems.  One might
want to charge more for CPU time on the faster system.
The problem is that a "fair" ratio would be difficult to
arrive at; the relative speeds of different systems can
depend on the particular type of activity being compared.
And billing based on an amortization of the system may not
make sense either, since by whatever benchmark one compares,
cost per unit work drops as systems get faster.



Quote:> Say I have TIME=00:20, does it mean the process consumed as much CPU as if
> it was running with 100% of the CPU during 20 seconds ?

--
ftp> get |fortune
377 I/O error: smart remark generator failed

Bogonics: the primary language inside the Beltway