I'm currently using xhprof
library forked by tideways.io for profiling myscript.php
execution. From xhprof
, i can get the walltime
, cputime
, memoryusage
, and peakmemoryusage
. I'm try to benchmark a symfony console - so i add TIDEWAYS_ENABLE()
on its ConsoleCommandEvent
and TIDEWAYS_DISABLE
on its ConsoleTerminateEvent
.
Questions:
- How can i determine whether
myscript.php
consume how many percentage of cpu ? Can i just count the percentage ascpuusage = cputime / realtime
like stated here on serverfault ? - Given a
memoryusage (mu)
andpeakmemoryusage (pmu)
fromxhprof
profiler, how do i convert or calculate itsram
usage ? (top
result show much higher thanmemoryusage
but somehow nearpeakmemoryusage
value, so can i say thatram
usage is the value ofpeakmemoryusage
?
Notes:
- It's different with this How can I get the CPU and Memory useage, because what i want is not the
system load
. p.s there might multiplescripts.php
running at the same time.