Allow a few more starting builds

This governor is fairly agressive, tune this value slightly now.

At this level, we generally can't start builds fast enough for
the other governors to hit their limits.  The goal is to slow
things down only enough that they hit, but not surpass them.

Change-Id: If3bedaa86f4c61b03ae3c2c7171d0efedce26046
This commit is contained in:
James E. Blair 2018-02-05 10:36:36 -08:00
parent 0ef8d12bfa
commit acb632d51b
2 changed files with 3 additions and 1 deletions

View File

@ -490,6 +490,7 @@ class TestGovernor(ZuulTestCase):
def test_slow_start(self):
self.executor_server.hold_jobs_in_build = True
self.executor_server.max_starting_builds = 1
self.executor_server.min_starting_builds = 1
self.executor_server.manageLoad()
self.assertTrue(self.executor_server.accepting_work)
A = self.fake_gerrit.addFakeChange('common-config', 'master', 'A')

View File

@ -1636,6 +1636,7 @@ class ExecutorServer(object):
'load_multiplier', '2.5'))
self.max_load_avg = multiprocessing.cpu_count() * load_multiplier
self.max_starting_builds = self.max_load_avg * 2
self.min_starting_builds = 4
self.min_avail_mem = float(get_default(self.config, 'executor',
'min_avail_mem', '5.0'))
self.accepting_work = False
@ -1975,7 +1976,7 @@ class ExecutorServer(object):
starting_builds += 1
max_starting_builds = max(
self.max_starting_builds - len(self.job_workers),
1)
self.min_starting_builds)
if self.accepting_work:
# Don't unregister if we don't have any active jobs.
if load_avg > self.max_load_avg: