@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add a "memory.hint" parameter to Aphlict

Summary:
Ref T10696. By default, `node` uses 1.5GB, which is enormous overkill for this service and can crowd out other services if it's running next to things like a database on the same host.

Provide a configuration option to adjust it via `--max-old-space-size` and default to 256MB. It only seems to need about 30M locally, so this should be plenty of headroom.

Test Plan:
Ran `bin/aphlict debug`, things seemed OK.

It takes a long time (days?) to grow to 1.5GB so I can't easily test this locally without a lot of work, but I'll keep an eye on it in production.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10696

Differential Revision: https://secure.phabricator.com/D15720

+17 -1
+14 -1
src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php
··· 78 78 'logs' => 'optional list<wild>', 79 79 'cluster' => 'optional list<wild>', 80 80 'pidfile' => 'string', 81 + 'memory.hint' => 'optional int', 81 82 )); 82 83 } catch (Exception $ex) { 83 84 throw new PhutilArgumentUsageException( ··· 508 509 return $root.'/support/aphlict/server/aphlict_server.js'; 509 510 } 510 511 512 + private function getNodeArgv() { 513 + $argv = array(); 514 + 515 + $hint = idx($this->configData, 'memory.hint'); 516 + $hint = nonempty($hint, 256); 517 + 518 + $argv[] = sprintf('--max-old-space-size=%d', $hint); 519 + 520 + return $argv; 521 + } 522 + 511 523 private function getStartCommand(array $server_argv) { 512 524 return csprintf( 513 - '%s %s %Ls', 525 + '%R %Ls -- %s %Ls', 514 526 $this->getNodeBinary(), 527 + $this->getNodeArgv(), 515 528 $this->getAphlictScriptPath(), 516 529 $server_argv); 517 530 }
+3
src/docs/user/configuration/notifications.diviner
··· 80 80 - `cluster`: //Optional list.// A list of cluster peers. This is an advanced 81 81 feature. 82 82 - `pidfile`: //Required string.// Path to a PID file. 83 + - `memory.hint`: //Optional int.// Suggestion to `node` about how much 84 + memory to use, via `--max-old-stack-size`. In most cases, this can be 85 + left unspecified. 83 86 84 87 Each server in the `servers` list should be an object with these keys: 85 88