@@ -72,7 +72,8 @@ their default values.
72
72
If you have a CPU-intensive workload, you may want to increase the number
73
73
of workers to the number of CPU cores (or 2x CPU cores). Lastly, if you are
74
74
using the ``greenlet `` worker type, you can easily run tens or hundreds of
75
- workers as they are extremely lightweight.
75
+ workers as they are extremely lightweight (however make sure, when using
76
+ Redis, that you create a large enough pool for all these connections).
76
77
77
78
``-k ``, ``--worker-type ``
78
79
Choose the worker type, ``thread ``, ``process `` or ``greenlet ``. The
@@ -91,7 +92,8 @@ their default values.
91
92
cheap in terms of memory, you can easily run a large number of workers.
92
93
Note that all code that does **not ** consist in waiting for a socket will
93
94
be blocking and cannot be pre-empted. Understand the tradeoffs before
94
- jumping to use greenlets.
95
+ jumping to use greenlets. When using with Redis, ensure that your
96
+ connection pool is large enough to provide connections for each greenlet.
95
97
* Anything else: use "thread". You get the benefits of pre-emptive
96
98
multi-tasking without the overhead of multiple processes. A safe choice
97
99
and the default.
@@ -214,7 +216,9 @@ different mechanisms to achieve this concurrency.
214
216
reason, gevent is a good choice for tasks that perform lots of socket I/O,
215
217
but may give worse performance for tasks that are CPU-bound (e.g., parsing
216
218
large files, manipulating images, generating reports, etc). Understand the
217
- tradeoff thoroughly before using this worker type.
219
+ tradeoff thoroughly before using this worker type. When using Redis, ensure
220
+ that your connection pool is large enough for each greenlet to have its own
221
+ connection.
218
222
219
223
When in doubt, the default setting (``thread ``) is a safe choice.
220
224
0 commit comments