in reply to CPU Usage by VirtualHost
I am fuzzy on whether the Apache handlers and processes are parent/child, siblings, single/same process, or something else. Perhaps the times function will do the job.
times Returns a four-element list giving the user and system times, in seconds, for this process and the children of this process.
( $user, $system, $cuser, $csystem ) = times;
This code shows that times does not wait until end-of-process or I/O operation to update its data source:
$ perl -wle 'sub r{@t=times();push @out,qq{@t}} sub x{my $z; $z.=1 for + 1..1_000_000;} r; x; r; x; r;print for @out' 0 0 0 0 0.17 0 0 0 0.29 0 0 0
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: CPU Usage by VirtualHost
by tdevil76 (Beadle) on Jun 09, 2007 at 01:57 UTC | |
by tdevil76 (Beadle) on Jun 09, 2007 at 02:29 UTC |