Ver código fonte

BROKER_POOL_LIMIT is now enabled by default with a limit of 10 connections

Ask Solem 13 anos atrás
pai
commit
5c5d18b8e0

+ 1 - 1
FAQ

@@ -455,7 +455,7 @@ How can I reuse the same connection when applying tasks?
 --------------------------------------------------------
 --------------------------------------------------------
 
 
 **Answer**: See the :setting:`BROKER_POOL_LIMIT` setting.
 **Answer**: See the :setting:`BROKER_POOL_LIMIT` setting.
-This setting will be enabled by default in 3.0.
+The connection pool is enabled by default since version 2.5.
 
 
 .. _faq-execute-task-by-name:
 .. _faq-execute-task-by-name:
 
 

+ 1 - 1
celery/app/defaults.py

@@ -73,7 +73,7 @@ NAMESPACES = {
         "CONNECTION_TIMEOUT": Option(4, type="int"),
         "CONNECTION_TIMEOUT": Option(4, type="int"),
         "CONNECTION_RETRY": Option(True, type="bool"),
         "CONNECTION_RETRY": Option(True, type="bool"),
         "CONNECTION_MAX_RETRIES": Option(100, type="int"),
         "CONNECTION_MAX_RETRIES": Option(100, type="int"),
-        "POOL_LIMIT": Option(None, type="int"),
+        "POOL_LIMIT": Option(10, type="int"),
         "INSIST": Option(False, type="bool",
         "INSIST": Option(False, type="bool",
                          deprecate_by="2.4", remove_by="3.0"),
                          deprecate_by="2.4", remove_by="3.0"),
         "USE_SSL": Option(False, type="bool"),
         "USE_SSL": Option(False, type="bool"),

+ 6 - 3
docs/configuration.rst

@@ -612,13 +612,16 @@ BROKER_POOL_LIMIT
 
 
 The maximum number of connections that can be open in the connection pool.
 The maximum number of connections that can be open in the connection pool.
 
 
-A good default value could be 10, or more if you're using eventlet/gevent
-or lots of threads.
+The pool is enabled by default since version 2.5, with a default limit of ten
+connections.  This number can be tweaked depending on the number of
+threads/greenthreads (eventlet/gevent) using a connection.  For example
+running eventlet with 1000 greenlets that use a connection to the broker,
+contention can arise and you should consider increasing the limit.
 
 
 If set to :const:`None` or 0 the connection pool will be disabled and
 If set to :const:`None` or 0 the connection pool will be disabled and
 connections will be established and closed for every use.
 connections will be established and closed for every use.
 
 
-**Disabled by default.**
+Default (since 2.5) is to use a pool of 10 connections.
 
 
 .. setting:: BROKER_CONNECTION_TIMEOUT
 .. setting:: BROKER_CONNECTION_TIMEOUT
 
 

+ 4 - 3
docs/userguide/executing.rst

@@ -199,12 +199,13 @@ Connections and connection timeouts.
 
 
 .. admonition:: Automatic Pool Support
 .. admonition:: Automatic Pool Support
 
 
-    In version 2.3 there is now support for automatic connection pools,
+    Since version 2.3 there is support for automatic connection pools,
     so you don't have to manually handle connections and publishers
     so you don't have to manually handle connections and publishers
     to reuse connections.
     to reuse connections.
 
 
-    See the :setting:`BROKER_POOL_LIMIT` setting.
-    This setting will be enabled by default in version 3.0.
+    The connection pool is enabled by default since version 2.5.
+
+    See the :setting:`BROKER_POOL_LIMIT` setting for more information.
 
 
 You can handle the connection manually by creating a
 You can handle the connection manually by creating a
 publisher:
 publisher:

+ 4 - 6
docs/userguide/optimizing.rst

@@ -57,13 +57,11 @@ General Settings
 Broker Connection Pools
 Broker Connection Pools
 -----------------------
 -----------------------
 
 
-You should enable the :setting:`BROKER_POOL_LIMIT` setting,
-as this will drastically improve overall performance.
+The broker connection pool is enabled by default since version 2.5.
 
 
-The value should be based on how many threads will use
-connections at the same time.
-
-This setting will be enabled by default in version 3.0.
+You can tweak the :setting:`BROKER_POOL_LIMIT` setting to minimize
+contention, and the value should be based on the number of
+active threads/greenthreads using broker connections.
 
 
 .. _optimizing-worker-settings:
 .. _optimizing-worker-settings: