From ed1071ec1981821275fedf35c5c90ab0a5080c58 Mon Sep 17 00:00:00 2001 From: Maru Newby Date: Mon, 20 Jan 2014 19:28:03 +0000 Subject: [PATCH] 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 --- neutron/wsgi.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- 2.45.2