Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14317972
D17432.id41913.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D17432.id41913.diff
View Options
diff --git a/src/daemon/PhutilDaemonPool.php b/src/daemon/PhutilDaemonPool.php
--- a/src/daemon/PhutilDaemonPool.php
+++ b/src/daemon/PhutilDaemonPool.php
@@ -9,6 +9,8 @@
private $daemons = array();
private $argv;
+ private $lastAutoscaleUpdate;
+
private function __construct() {
// <empty>
}
@@ -184,22 +186,41 @@
}
private function updateAutoscale() {
+ // Don't try to autoscale more than once per second. This mostly stops the
+ // logs from getting flooded in verbose mode.
+ $now = time();
+ if ($this->lastAutoscaleUpdate >= $now) {
+ return;
+ }
+ $this->lastAutoscaleUpdate = $now;
+
$daemons = $this->getDaemons();
// If this pool is already at the maximum size, we can't launch any new
// daemons.
$max_size = $this->getPoolMaximumSize();
if (count($daemons) >= $max_size) {
+ $this->logMessage(
+ 'POOL',
+ pht(
+ 'Autoscale pool "%s" already at maximum size (%d of %d).',
+ $this->getPoolLabel(),
+ new PhutilNumber(count($daemons)),
+ new PhutilNumber($max_size)));
return;
}
- $now = time();
$scaleup_duration = $this->getPoolScaleupDuration();
foreach ($daemons as $daemon) {
$busy_epoch = $daemon->getBusyEpoch();
// If any daemons haven't started work yet, don't scale the pool up.
if (!$busy_epoch) {
+ $this->logMessage(
+ 'POOL',
+ pht(
+ 'Autoscale pool "%s" has an idle daemon, declining to scale.',
+ $this->getPoolLabel()));
return;
}
@@ -207,6 +228,14 @@
// to scale the pool up.
$busy_for = ($now - $busy_epoch);
if ($busy_for < $scaleup_duration) {
+ $this->logMessage(
+ 'POOL',
+ pht(
+ 'Autoscale pool "%s" has not been busy long enough to scale up '.
+ '(busy for %s of %s seconds).',
+ $this->getPoolLabel(),
+ new PhutilNumber($busy_for),
+ new PhutilNumber($scaleup_duration)));
return;
}
}
@@ -228,6 +257,14 @@
// If we don't have enough free memory, don't scale.
if ($free_ratio <= $reserve) {
+ $this->logMessage(
+ 'POOL',
+ pht(
+ 'Autoscale pool "%s" does not have enough free memory to '.
+ 'scale up (%s free of %s reserved).',
+ $this->getPoolLabel(),
+ new PhutilNumber($free_ratio, 3),
+ new PhutilNumber($reserve, 3)));
return;
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 19, 8:30 AM (20 h, 21 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6906495
Default Alt Text
D17432.id41913.diff (2 KB)
Attached To
Mode
D17432: Add more autoscale pool logging to daemons in verbose mode
Attached
Detach File
Event Timeline
Log In to Comment