@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.

Remove the "25% of active pool" growth rate throttle from Drydock

Summary:
Ref T13677. Drydock has a hard-coded and fairly arbitrary limit which prevents a resource pool from growing more than 25% at once.

This is vaguely reasonable for resources which allocate quickly, but suffocating for slower resources. It's also wholly arbitrary, and the "one per lease" limit introduced in D21807 should do a better job of covering the same ground while generally being more reasonable, expected, and predictable.

Test Plan: Ran Drydock allocations without the throttle, saw faster pool growth.

Subscribers: yelirekim, PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13677

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

+11 -35
+11 -35
src/applications/drydock/blueprint/DrydockBlueprintImplementation.php
··· 506 506 protected function shouldLimitAllocatingPoolSize( 507 507 DrydockBlueprint $blueprint) { 508 508 509 - // TODO: If this mechanism sticks around, these values should be 510 - // configurable by the blueprint implementation. 511 - 512 509 // Limit on total number of active resources. 513 510 $total_limit = $this->getConcurrentResourceLimit($blueprint); 514 - 515 - // Always allow at least this many allocations to be in flight at once. 516 - $min_allowed = 1; 517 - 518 - // Allow this fraction of allocating resources as a fraction of active 519 - // resources. 520 - $growth_factor = 0.25; 511 + if ($total_limit === null) { 512 + return false; 513 + } 521 514 522 515 $resource = new DrydockResource(); 523 - $conn_r = $resource->establishConnection('r'); 516 + $conn = $resource->establishConnection('r'); 524 517 525 518 $counts = queryfx_all( 526 - $conn_r, 527 - 'SELECT status, COUNT(*) N FROM %T 519 + $conn, 520 + 'SELECT status, COUNT(*) N FROM %R 528 521 WHERE blueprintPHID = %s AND status != %s 529 522 GROUP BY status', 530 - $resource->getTableName(), 523 + $resource, 531 524 $blueprint->getPHID(), 532 525 DrydockResourceStatus::STATUS_DESTROYED); 533 526 $counts = ipull($counts, 'N', 'status'); ··· 539 532 540 533 // If we're at the limit on total active resources, limit additional 541 534 // allocations. 542 - if ($total_limit !== null) { 543 - $n_total = ($n_alloc + $n_active + $n_broken + $n_released); 544 - if ($n_total >= $total_limit) { 545 - return true; 546 - } 535 + $n_total = ($n_alloc + $n_active + $n_broken + $n_released); 536 + if ($n_total >= $total_limit) { 537 + return true; 547 538 } 548 539 549 - // If the number of in-flight allocations is fewer than the minimum number 550 - // of allowed allocations, don't impose a limit. 551 - if ($n_alloc < $min_allowed) { 552 - return false; 553 - } 554 - 555 - $allowed_alloc = (int)ceil($n_active * $growth_factor); 556 - 557 - // If the number of in-flight allocation is fewer than the number of 558 - // allowed allocations according to the pool growth factor, don't impose 559 - // a limit. 560 - if ($n_alloc < $allowed_alloc) { 561 - return false; 562 - } 563 - 564 - return true; 540 + return false; 565 541 } 566 542 567 543 }