Minimize the cost of checking for api worker exit

A recent change to oslo allows the configuration of the interval
that ProcessLauncher waits between checks of child exit.  The
default interval of 0.01s resulted in the neutron service consuming
unnecessary cpu cycles checking whether api workers had exited (5%
cpu on idle in a VM).  This patch extends the interval to 1s to
minimize the cost of the checks.

Change-Id: I0407ccb2db65cd3839586faff15e70dbc35f005e
Closes-bug: #1095346
This commit is contained in:
Maru Newby 2014-01-20 19:28:03 +00:00
parent 49efd608d3
commit ed1071ec19
1 changed files with 3 additions and 1 deletions

View File

@ -211,7 +211,9 @@ class Server(object):
self._server = self.pool.spawn(self._run, application,
self._socket)
else:
self._launcher = ProcessLauncher()
# Minimize the cost of checking for child exit by extending the
# wait interval past the default of 0.01s.
self._launcher = ProcessLauncher(wait_interval=1.0)
self._server = WorkerService(self, application)
self._launcher.launch_service(self._server, workers=workers)