Browse Source

Renames processes -> prefork

Ask Solem 11 years ago
parent
commit
b2b6236acc

+ 2 - 2
celery/app/defaults.py

@@ -22,14 +22,14 @@ __all__ = ['Option', 'NAMESPACES', 'flatten', 'find']
 is_jython = sys.platform.startswith('java')
 is_pypy = hasattr(sys, 'pypy_version_info')
 
-DEFAULT_POOL = 'processes'
+DEFAULT_POOL = 'prefork'
 if is_jython:
     DEFAULT_POOL = 'threads'
 elif is_pypy:
     if sys.pypy_version_info[0:3] < (1, 5, 0):
         DEFAULT_POOL = 'solo'
     else:
-        DEFAULT_POOL = 'processes'
+        DEFAULT_POOL = 'prefork'
 
 DEFAULT_ACCEPT_CONTENT = ['json', 'pickle', 'msgpack', 'yaml']
 DEFAULT_PROCESS_LOG_FMT = """

+ 1 - 1
celery/bin/worker.py

@@ -18,7 +18,7 @@ The :program:`celery worker` command (previously known as ``celeryd``)
 
     Pool implementation:
 
-    processes (default), eventlet, gevent, solo or threads.
+    prefork (default), eventlet, gevent, solo or threads.
 
 .. cmdoption:: -f, --logfile
 

+ 2 - 1
celery/concurrency/__init__.py

@@ -16,11 +16,12 @@ from kombu.utils import symbol_by_name
 __all__ = ['get_implementation']
 
 ALIASES = {
-    'processes': 'celery.concurrency.processes:TaskPool',
+    'prefork': 'celery.concurrency.prefork:TaskPool',
     'eventlet': 'celery.concurrency.eventlet:TaskPool',
     'gevent': 'celery.concurrency.gevent:TaskPool',
     'threads': 'celery.concurrency.threads:TaskPool',
     'solo': 'celery.concurrency.solo:TaskPool',
+    'processes': 'celery.concurrency.prefork:TaskPool',  # XXX compat alias
 }
 
 

+ 0 - 0
celery/concurrency/processes.py → celery/concurrency/prefork.py


+ 1 - 1
celery/tests/app/test_defaults.py

@@ -34,7 +34,7 @@ class test_defaults(AppCase):
     def test_default_pool_pypy_15(self):
         with sys_platform('darwin'):
             with pypy_version((1, 5, 0)):
-                self.assertEqual(self.defaults.DEFAULT_POOL, 'processes')
+                self.assertEqual(self.defaults.DEFAULT_POOL, 'prefork')
 
     def test_deprecated(self):
         source = Mock()

+ 1 - 1
celery/tests/concurrency/test_pool.py

@@ -32,7 +32,7 @@ class test_TaskPool(AppCase):
             __import__('multiprocessing')
         except ImportError:
             raise SkipTest('multiprocessing not supported')
-        from celery.concurrency.processes import TaskPool
+        from celery.concurrency.prefork import TaskPool
         self.TaskPool = TaskPool
 
     def test_attrs(self):

+ 1 - 1
celery/tests/concurrency/test_processes.py → celery/tests/concurrency/test_prefork.py

@@ -13,7 +13,7 @@ from celery.five import items, range
 from celery.utils.functional import noop
 from celery.tests.case import AppCase
 try:
-    from celery.concurrency import processes as mp
+    from celery.concurrency import prefork as mp
 except ImportError:
 
     class _mp(object):

+ 2 - 2
celery/tests/worker/test_worker.py

@@ -781,7 +781,7 @@ class test_WorkController(AppCase):
         with restore_logging():
             from celery import signals
             from celery._state import _tls
-            from celery.concurrency.processes import (
+            from celery.concurrency.prefork import (
                 process_initializer, WORKER_SIGRESET, WORKER_SIGIGNORE,
             )
 
@@ -1058,7 +1058,7 @@ class test_WorkController(AppCase):
         poolimp._fileno_to_inq = {}
         poolimp._fileno_to_outq = {}
 
-        from celery.concurrency.processes import TaskPool as _TaskPool
+        from celery.concurrency.prefork import TaskPool as _TaskPool
 
         class MockTaskPool(_TaskPool):
             Pool = PoolImp

+ 2 - 2
docs/configuration.rst

@@ -1236,7 +1236,7 @@ The modules in this setting are imported after the modules in
 CELERYD_FORCE_EXECV
 ~~~~~~~~~~~~~~~~~~~
 
-On Unix the processes pool will fork, so that child processes
+On Unix the prefork pool will fork, so that child processes
 start with the same memory as the parent process.
 
 This can cause problems as there is a known deadlock condition
@@ -1702,7 +1702,7 @@ Name of the pool class used by the worker.
     You must use the `-P` option instead, otherwise the monkey patching
     will happen too late and things will break in strange and silent ways.
 
-Default is ``celery.concurrency.processes:TaskPool``.
+Default is ``celery.concurrency.prefork:TaskPool``.
 
 .. setting:: CELERYD_POOL_RESTARTS
 

+ 1 - 1
docs/faq.rst

@@ -286,7 +286,7 @@ most systems), it usually contains a message describing the reason.
 Does it work on FreeBSD?
 ------------------------
 
-**Answer:** The multiprocessing pool requires a working POSIX semaphore
+**Answer:** The prefork pool requires a working POSIX semaphore
 implementation which isn't enabled in FreeBSD by default. You have to enable
 POSIX semaphores in the kernel and manually recompile multiprocessing.
 

+ 1 - 1
docs/getting-started/introduction.rst

@@ -125,7 +125,7 @@ Celery is…
 
         - **Concurrency**
 
-            - multiprocessing,
+            - prefork (multiprocessing),
             - Eventlet_, gevent_
             - threads/single threaded
 

+ 2 - 2
docs/getting-started/next-steps.rst

@@ -96,7 +96,7 @@ When the worker starts you should see a banner and some messages::
 module, you can also specify a different broker on the command-line by using
 the :option:`-b` option.
 
--- *Concurrency* is the number of multiprocessing worker process used
+-- *Concurrency* is the number of prefork worker process used
 to process your tasks concurrently, when all of these are busy doing work
 new tasks will have to wait for one of the tasks to finish before
 it can be processed.
@@ -109,7 +109,7 @@ it, experimentation has shown that adding more than twice the number
 of CPU's is rarely effective, and likely to degrade performance
 instead.
 
-Including the default multiprocessing pool, Celery also supports using
+Including the default prefork pool, Celery also supports using
 Eventlet, Gevent, and threads (see :ref:`concurrency`).
 
 -- *Events* is an option that when enabled causes Celery to send

+ 1 - 1
docs/includes/introduction.txt

@@ -126,7 +126,7 @@ It supports...
 
     - **Concurrency**
 
-        - multiprocessing, Eventlet_, gevent_, threads/single threaded
+        - Prefork, Eventlet_, gevent_, threads/single threaded
 
     - **Result Stores**
 

+ 1 - 1
docs/internals/guide.rst

@@ -268,7 +268,7 @@ Module Overview
 
 - celery.concurrency
 
-    Execution pool implementations (processes, eventlet, gevent, threads).
+    Execution pool implementations (prefork, eventlet, gevent, threads).
 
 - celery.db
 

+ 3 - 3
docs/internals/reference/celery.concurrency.processes.rst → docs/internals/reference/celery.concurrency.prefork.rst

@@ -1,11 +1,11 @@
 =============================================================
- celery.concurrency.processes
+ celery.concurrency.prefork
 =============================================================
 
 .. contents::
     :local:
-.. currentmodule:: celery.concurrency.processes
+.. currentmodule:: celery.concurrency.prefork
 
-.. automodule:: celery.concurrency.processes
+.. automodule:: celery.concurrency.prefork
     :members:
     :undoc-members:

+ 1 - 1
docs/internals/reference/index.rst

@@ -17,7 +17,7 @@
     celery.worker.autoscale
     celery.concurrency
     celery.concurrency.solo
-    celery.concurrency.processes
+    celery.concurrency.prefork
     celery.concurrency.eventlet
     celery.concurrency.gevent
     celery.concurrency.base

+ 1 - 1
docs/userguide/application.rst

@@ -184,7 +184,7 @@ Example 2: Using a configuration module
 
     Using the name of a module is recomended
     as this means that the module doesn't need to be serialized
-    when the multiprocessing pool is used.  If you're
+    when the prefork pool is used.  If you're
     experiencing configuration pickle errors then please try using
     the name of a module instead.
 

+ 4 - 4
docs/userguide/concurrency/eventlet.rst

@@ -22,18 +22,18 @@ change how you run your code, not how you write it.
       from the Python interpreter, or as a small part of a larger application.
 
 Celery supports Eventlet as an alternative execution pool implementation.
-It is in some cases superior to multiprocessing, but you need to ensure
+It is in some cases superior to prefork, but you need to ensure
 your tasks do not perform blocking calls, as this will halt all
 other operations in the worker until the blocking call returns.
 
-The multiprocessing pool can take use of multiple processes, but how many is
+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
 spawn hundreds, or thousands of green threads.  In an informal test with a
 feed hub system the Eventlet pool could fetch and process hundreds of feeds
-every second, while the multiprocessing pool spent 14 seconds processing 100
+every second, while the prefork pool spent 14 seconds processing 100
 feeds.  Note that is one of the applications evented I/O is especially good
 at (asynchronous HTTP requests).  You may want a mix of both Eventlet and
-multiprocessing workers, and route tasks according to compatibility or
+prefork workers, and route tasks according to compatibility or
 what works best.
 
 Enabling Eventlet

+ 1 - 1
docs/userguide/signals.rst

@@ -249,7 +249,7 @@ Provides arguments:
 * request
 
     This is a :class:`~celery.worker.job.Request` instance, and not
-    ``task.request``.   When using the multiprocessing pool this signal
+    ``task.request``.   When using the prefork pool this signal
     is dispatched in the parent process, so ``task.request`` is not available
     and should not be used.  Use this object instead, which should have many
     of the same fields.

+ 8 - 8
docs/userguide/workers.rst

@@ -133,7 +133,7 @@ but you can also use :ref:`Eventlet <concurrency-eventlet>`.  The number
 of worker processes/threads can be changed using the :option:`--concurrency`
 argument and defaults to the number of CPUs available on the machine.
 
-.. admonition:: Number of processes (multiprocessing)
+.. admonition:: Number of processes (multiprocessing/prefork pool)
 
     More pool processes are usually better, but there's a cut-off point where
     adding more pool processes affects performance in negative ways.
@@ -156,7 +156,7 @@ Remote control
     commands from the command-line.  It supports all of the commands
     listed below.  See :ref:`monitoring-control` for more information.
 
-pool support: *processes, eventlet, gevent*, blocking:*threads/solo* (see note)
+pool support: *prefork, eventlet, gevent*, blocking:*threads/solo* (see note)
 broker support: *amqp, redis, mongodb*
 
 Workers have the ability to be remote controlled using a high-priority
@@ -325,7 +325,7 @@ Time Limits
 
 .. versionadded:: 2.0
 
-pool support: *processes*
+pool support: *prefork/gevent*
 
 .. sidebar:: Soft, or hard?
 
@@ -418,7 +418,7 @@ Max tasks per child setting
 
 .. versionadded:: 2.0
 
-pool support: *processes*
+pool support: *prefork*
 
 With this option you can configure the maximum number of tasks
 a worker can execute before it's replaced by a new process.
@@ -436,7 +436,7 @@ Autoscaling
 
 .. versionadded:: 2.2
 
-pool support: *processes*, *gevent*
+pool support: *prefork*, *gevent*
 
 The *autoscaler* component is used to dynamically resize the pool
 based on load:
@@ -605,7 +605,7 @@ Autoreloading
 
 .. versionadded:: 2.5
 
-pool support: *processes, eventlet, gevent, threads, solo*
+pool support: *prefork, eventlet, gevent, threads, solo*
 
 Starting :program:`celery worker` with the :option:`--autoreload` option will
 enable the worker to watch for file system changes to all imported task
@@ -621,7 +621,7 @@ the Django ``runserver`` command.
 When auto-reload is enabled the worker starts an additional thread
 that watches for changes in the file system.  New modules are imported,
 and already imported modules are reloaded whenever a change is detected,
-and if the processes pool is used the child processes will finish the work
+and if the prefork pool is used the child processes will finish the work
 they are doing and exit, so that they can be replaced by fresh processes
 effectively reloading the code.
 
@@ -917,7 +917,7 @@ The output will include the following fields:
 
     * ``writes``
 
-        Specific to the processes pool, this shows the distribution of writes
+        Specific to the prefork pool, this shows the distribution of writes
         to each process in the pool when using async I/O.
 
 - ``prefetch_count``

+ 2 - 2
docs/whatsnew-2.5.rst

@@ -88,7 +88,7 @@ together:
 
     CELERYD_FORCE_EXECV = True
 
-This setting is recommended for all users using the processes pool,
+This setting is recommended for all users using the prefork pool,
 but especially users also using time limits or a max tasks per child
 setting.
 
@@ -226,7 +226,7 @@ the Django ``runserver`` command.
 When auto-reload is enabled the worker starts an additional thread
 that watches for changes in the file system.  New modules are imported,
 and already imported modules are reloaded whenever a change is detected,
-and if the processes pool is used the child processes will finish the work
+and if the prefork pool is used the child processes will finish the work
 they are doing and exit, so that they can be replaced by fresh processes
 effectively reloading the code.
 

+ 1 - 1
extra/bash-completion/celery.bash

@@ -14,7 +14,7 @@ _celery()
     fargs="--app= --broker= --loader= --config= --version"
     dopts="--detach --umask= --gid= --uid= --pidfile= --logfile= --loglevel="
     controlargs="--timeout --destination"
-    pools="processes eventlet gevent threads solo"
+    pools="prefork eventlet gevent threads solo"
     loglevels="critical error warning info debug"
     in_opt=0
 

+ 1 - 1
extra/zsh-completion/celery.zsh

@@ -39,7 +39,7 @@ case "$words[1]" in
     worker)
     _arguments \
     '(-C --concurrency=)'{-C,--concurrency=}'[Number of child processes processing the queue. The default is the number of CPUs.]' \
-    '(--pool)--pool=:::(processes eventlet gevent threads solo)' \
+    '(--pool)--pool=:::(prefork eventlet gevent threads solo)' \
     '(--purge --discard)'{--discard,--purge}'[Purges all waiting tasks before the daemon is started.]' \
     '(-f --logfile=)'{-f,--logfile=}'[Path to log file. If no logfile is specified, stderr is used.]' \
     '(--loglevel=)--loglevel=:::(critical error warning info debug)' \