Add extra workers if computing based on memory

Co-authored-by: Elijah DeLee <kdelee@redhat.com>
This commit is contained in:
Alan Rominger 2022-07-14 15:54:44 -04:00
parent 16be38bb54
commit 621833ef0e
No known key found for this signature in database
GPG Key ID: C2D7EAAA12B63559

View File

@ -341,6 +341,10 @@ class AutoscalePool(WorkerPool):
# Get same number as max forks based on memory, this function takes memory as bytes
self.max_workers = get_mem_effective_capacity(total_memory_gb * 2**30)
# add magic prime number of extra workers to ensure
# we have a few extra workers to run the heartbeat
self.max_workers += 7
# max workers can't be less than min_workers
self.max_workers = max(self.min_workers, self.max_workers)