From 28dbb6bd58551e782f17fe81e995176da5951638 Mon Sep 17 00:00:00 2001 From: derek_kim Date: Tue, 15 May 2018 20:49:28 +0900 Subject: [PATCH] Changed documentation on eventlet (#4724) * This is redundant because symbol_by_name will be called for self.registry_clss in __init__ method * Corrected 'blocking call' to 'CPU-bound operation' * additional changes in the comment after review --- docs/userguide/concurrency/eventlet.rst | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/userguide/concurrency/eventlet.rst b/docs/userguide/concurrency/eventlet.rst index 8edd43097aa..4695c843bbd 100644 --- a/docs/userguide/concurrency/eventlet.rst +++ b/docs/userguide/concurrency/eventlet.rst @@ -21,10 +21,16 @@ change how you run your code, not how you write it. * The event dispatch is implicit: meaning you can easily use Eventlet from the Python interpreter, or as a small part of a larger application. -Celery supports Eventlet as an alternative execution pool implementation. -It's in some cases superior to prefork, but you need to ensure -your tasks don't perform blocking calls, as this will halt all -other operations in the worker until the blocking call returns. + +Celery supports Eventlet as an alternative execution pool implementation and +in some cases superior to prefork. However, you need to ensure one task doesn't +block the event loop too long. Generally, CPU-bound operations don't go well +with Evenetlet. Also note that some libraries, usually with C extensions, +cannot be monkeypatched and therefore cannot benefit from using Eventlet. +Please refer to their documentation if you are not sure. For example, pylibmc +does not allow cooperation with Eventlet but psycopg2 does when both of them +are libraries with C extensions. + The prefork pool can take use of multiple processes, but how many is often limited to a few processes per CPU. With Eventlet you can efficiently