mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 01:17:37 -02:30
Add extra workers if computing based on memory
Co-authored-by: Elijah DeLee <kdelee@redhat.com>
This commit is contained in:
@@ -341,6 +341,10 @@ class AutoscalePool(WorkerPool):
|
|||||||
# Get same number as max forks based on memory, this function takes memory as bytes
|
# 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)
|
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
|
# max workers can't be less than min_workers
|
||||||
self.max_workers = max(self.min_workers, self.max_workers)
|
self.max_workers = max(self.min_workers, self.max_workers)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user