mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 21:40:55 +01:00
Allow the Fact daemon to hibernate
Summary: A handful of Phacility production shards have run into memory pressure issues recently. Although there's no smoking gun, and at least two other plausible contributors, one possible concern is that the Fact daemon was written before hibernation and can not currently hibernate. Even if there's no memory leak, this creates unnecessary memory pressure by holding the processes in memory. Allow the Fact daemon to hibernate, like other daemons do. Test Plan: Ran "bin/phd debug fact", saw the Fact daemon hibernate. Subscribers: yelirekim Differential Revision: https://secure.phabricator.com/D21389
This commit is contained in:
parent
7d496f2c6d
commit
205657ac76
1 changed files with 9 additions and 4 deletions
|
@ -6,7 +6,7 @@ final class PhabricatorFactDaemon extends PhabricatorDaemon {
|
|||
|
||||
protected function run() {
|
||||
$this->setEngines(PhabricatorFactEngine::loadAllEngines());
|
||||
while (!$this->shouldExit()) {
|
||||
do {
|
||||
PhabricatorCaches::destroyRequestCache();
|
||||
|
||||
$iterators = $this->getAllApplicationIterators();
|
||||
|
@ -14,9 +14,14 @@ final class PhabricatorFactDaemon extends PhabricatorDaemon {
|
|||
$this->processIteratorWithCursor($iterator_name, $iterator);
|
||||
}
|
||||
|
||||
$this->log(pht('Zzz...'));
|
||||
$this->sleep(15);
|
||||
}
|
||||
$sleep_duration = 60;
|
||||
|
||||
if ($this->shouldHibernate($sleep_duration)) {
|
||||
break;
|
||||
}
|
||||
|
||||
$this->sleep($sleep_duration);
|
||||
} while (!$this->shouldExit());
|
||||
}
|
||||
|
||||
public static function getAllApplicationIterators() {
|
||||
|
|
Loading…
Reference in a new issue