From 71aad6b83106498f7299267253a54b3595a8cbcc Mon Sep 17 00:00:00 2001 From: abhishekkekane Date: Fri, 12 Sep 2014 00:15:38 -0700 Subject: [PATCH] Eventlet green threads not released back to pool Presently, the wsgi server allows persist connections hence even after the response is sent to the client, it doesn't close the client socket connection. Because of this problem, the green thread is not released back to the pool. In order to close the client socket connection explicitly after the response is sent and read successfully by the client, you simply have to set keepalive to False when you create a wsgi server. --- cinder/wsgi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cinder/wsgi.py b/cinder/wsgi.py index 81533a6..790d9ae 100644 --- a/cinder/wsgi.py +++ b/cinder/wsgi.py @@ -224,7 +224,8 @@ class Server(object): 'site': self.app, 'protocol': self._protocol, 'custom_pool': self._pool, - 'log': self._wsgi_logger + 'log': self._wsgi_logger, + 'keepalive': False } self._server = eventlet.spawn(**wsgi_kwargs) -- 1.9.1