From: Maru Newby Date: Mon, 20 Jan 2014 19:28:03 +0000 (+0000) Subject: Minimize the cost of checking for api worker exit X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=dfc4944f7159d0097f376fb3545aee342fa805ae;p=openstack-build%2Fneutron-build.git 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 --- diff --git a/neutron/wsgi.py b/neutron/wsgi.py index 9e7964b45..981efbd98 100644 --- a/neutron/wsgi.py +++ b/neutron/wsgi.py @@ -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)