[rhmessaging-commits] rhmessaging commits: r4334 - in mgmt/newdata/wooly/python/wooly: wsgiserver and 1 other directory.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Thu Sep 23 09:49:25 EDT 2010


Author: justi9
Date: 2010-09-23 09:49:25 -0400 (Thu, 23 Sep 2010)
New Revision: 4334

Modified:
   mgmt/newdata/wooly/python/wooly/server.py
   mgmt/newdata/wooly/python/wooly/wsgiserver/__init__.py
Log:
For bz 63581.  Grow and shrink the worker thread pool as needed.
Adjust the socket backfill and initial threads.


Modified: mgmt/newdata/wooly/python/wooly/server.py
===================================================================
--- mgmt/newdata/wooly/python/wooly/server.py	2010-09-22 21:42:13 UTC (rev 4333)
+++ mgmt/newdata/wooly/python/wooly/server.py	2010-09-23 13:49:25 UTC (rev 4334)
@@ -204,8 +204,8 @@
         self.wsgi_server = CherryPyWSGIServer \
             ((self.server.host, self.server.port),
              self.server.service_request,
-             request_queue_size=40,
-             numthreads=20)
+             request_queue_size=32,
+             numthreads=32)
 
         self.wsgi_server.environ["wsgi.version"] = (1, 1)
 

Modified: mgmt/newdata/wooly/python/wooly/wsgiserver/__init__.py
===================================================================
--- mgmt/newdata/wooly/python/wooly/wsgiserver/__init__.py	2010-09-22 21:42:13 UTC (rev 4333)
+++ mgmt/newdata/wooly/python/wooly/wsgiserver/__init__.py	2010-09-23 13:49:25 UTC (rev 4334)
@@ -1676,6 +1676,13 @@
                 if self.interrupt:
                     raise self.interrupt
     
+            idle = self.requests.idle
+
+            if idle < 16:
+                self.requests.grow(16)
+            elif idle > 32:
+                self.requests.shrink(2)
+
     def bind(self, family, type, proto=0):
         """Create (or recreate) the actual socket object."""
         self.socket = socket.socket(family, type, proto)



More information about the rhmessaging-commits mailing list