Last modified: 2014-09-11 19:13:05 UTC
The PHP function getrusage() invokes the system call of the same name with RUSAGE_SELF, which requests usage information for the calling process. Callers of getrusage() in MediaWiki assume the PHP process is not shared by multiple requests, and that the resource usage measured by RUSAGE_SELF is thus attributable to the current request. These assumptions are false under HHVM. Unfortunately, the getrusage() PHP function currently does not allow callers to request RUSAGE_THREAD info. I submitted a pull-request to HHVM to add this feature: <https://github.com/facebook/hhvm/pull/3632>. We need to update ParserOutput::getTimes and Profiler::getTime once it is merged. The other caller of getrusage() is a benchmarkParse.php. It doesn't need to be fixed, because it's a standalone maintenance script.
Change 158550 had a related patch set uploaded by Ori.livneh: Add wfGetRusage(), wrapping getrusage(2) syscall https://gerrit.wikimedia.org/r/158550
Change 158550 merged by jenkins-bot: Under HHVM, measure resources for the thread, not calling process https://gerrit.wikimedia.org/r/158550
Change 159703 had a related patch set uploaded by Ori.livneh: Under HHVM, measure resources for the thread, not calling process https://gerrit.wikimedia.org/r/159703
Change 159704 had a related patch set uploaded by Ori.livneh: Under HHVM, measure resources for the thread, not calling process https://gerrit.wikimedia.org/r/159704
Change 159704 merged by jenkins-bot: Under HHVM, measure resources for the thread, not calling process https://gerrit.wikimedia.org/r/159704
Change 159703 merged by jenkins-bot: Under HHVM, measure resources for the thread, not calling process https://gerrit.wikimedia.org/r/159703