celery.conf.rst 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. ============================
  2. Configuration - celery.conf
  3. ============================
  4. .. contents::
  5. :local:
  6. .. currentmodule:: celery.conf
  7. .. data:: QUEUES
  8. Queue name/options mapping.
  9. .. data:: DEFAULT_QUEUE
  10. Name of the default queue.
  11. .. data:: DEFAULT_EXCHANGE
  12. Default exchange.
  13. .. data:: DEFAULT_EXCHANGE_TYPE
  14. Default exchange type.
  15. .. data:: DEFAULT_DELIVERY_MODE
  16. Default delivery mode (``"persistent"`` or ``"non-persistent"``).
  17. Default is ``"persistent"``.
  18. .. data:: DEFAULT_ROUTING_KEY
  19. Default routing key used when sending tasks.
  20. .. data:: BROKER_CONNECTION_TIMEOUT
  21. The timeout in seconds before we give up establishing a connection
  22. to the AMQP server.
  23. .. data:: BROADCAST_QUEUE
  24. Name prefix for the queue used when listening for
  25. broadcast messages. The workers hostname will be appended
  26. to the prefix to create the final queue name.
  27. Default is ``"celeryctl"``.
  28. .. data:: BROADCAST_EXCHANGE
  29. Name of the exchange used for broadcast messages.
  30. Default is ``"celeryctl"``.
  31. .. data:: BROADCAST_EXCHANGE_TYPE
  32. Exchange type used for broadcast messages. Default is ``"fanout"``.
  33. .. data:: EVENT_QUEUE
  34. Name of queue used to listen for event messages. Default is
  35. ``"celeryevent"``.
  36. .. data:: EVENT_EXCHANGE
  37. Exchange used to send event messages. Default is ``"celeryevent"``.
  38. .. data:: EVENT_EXCHANGE_TYPE
  39. Exchange type used for the event exchange. Default is ``"topic"``.
  40. .. data:: EVENT_ROUTING_KEY
  41. Routing key used for events. Default is ``"celeryevent"``.
  42. .. data:: EVENT_SERIALIZER
  43. Type of serialization method used to serialize events. Default is
  44. ``"json"``.
  45. .. data:: RESULT_EXCHANGE
  46. Exchange used by the AMQP result backend to publish task results.
  47. Default is ``"celeryresult"``.
  48. .. data:: CELERY_SEND_TASK_ERROR_EMAILS
  49. If set to ``True``, errors in tasks will be sent to admins by e-mail.
  50. If unset, it will send the e-mails if ``settings.DEBUG`` is ``True``.
  51. .. data:: ALWAYS_EAGER
  52. Always execute tasks locally, don't send to the queue.
  53. .. data:: EAGER_PROPAGATES_EXCEPTIONS
  54. If set to ``True``, :func:`celery.execute.apply` will re-raise task exceptions.
  55. It's the same as always running apply with ``throw=True``.
  56. .. data:: TASK_RESULT_EXPIRES
  57. Task tombstone expire time in seconds.
  58. .. data:: IGNORE_RESULT
  59. If enabled, the default behavior will be to not store task results.
  60. .. data:: TRACK_STARTED
  61. If enabled, the default behavior will be to track when tasks starts by
  62. storing the :const:`STARTED` state.
  63. .. data:: ACKS_LATE
  64. If enabled, the default behavior will be to acknowledge task messages
  65. after the task is executed.
  66. .. data:: STORE_ERRORS_EVEN_IF_IGNORED
  67. If enabled, task errors will be stored even though ``Task.ignore_result``
  68. is enabled.
  69. .. data:: MAX_CACHED_RESULTS
  70. Total number of results to store before results are evicted from the
  71. result cache.
  72. .. data:: BROKER_CONNECTION_RETRY
  73. Automatically try to re-establish the connection to the AMQP broker if
  74. it's lost.
  75. .. data:: BROKER_CONNECTION_MAX_RETRIES
  76. Maximum number of retries before we give up re-establishing a connection
  77. to the broker.
  78. If this is set to ``0`` or ``None``, we will retry forever.
  79. Default is ``100`` retries.
  80. .. data:: TASK_SERIALIZER
  81. A string identifying the default serialization
  82. method to use. Can be ``pickle`` (default),
  83. ``json``, ``yaml``, or any custom serialization methods that have
  84. been registered with :mod:`carrot.serialization.registry`.
  85. Default is ``pickle``.
  86. .. data:: RESULT_BACKEND
  87. The backend used to store task results (tombstones).
  88. .. data:: CELERY_CACHE_BACKEND
  89. Celery cache backend.
  90. .. data:: SEND_EVENTS
  91. If set, celery will send events that can be captured by monitors like
  92. ``celerymon``.
  93. Default is: ``False``.
  94. .. data:: DEFAULT_RATE_LIMIT
  95. The default rate limit applied to all tasks which doesn't have a custom
  96. rate limit defined. (Default: None)
  97. .. data:: DISABLE_RATE_LIMITS
  98. If ``True`` all rate limits will be disabled and all tasks will be executed
  99. as soon as possible.
  100. .. data:: CELERYBEAT_LOG_LEVEL
  101. Default log level for celerybeat.
  102. Default is: ``INFO``.
  103. .. data:: CELERYBEAT_LOG_FILE
  104. Default log file for celerybeat.
  105. Default is: ``None`` (stderr)
  106. .. data:: CELERYBEAT_SCHEDULE_FILENAME
  107. Name of the persistent schedule database file.
  108. Default is: ``celerybeat-schedule``.
  109. .. data:: CELERYBEAT_MAX_LOOP_INTERVAL
  110. The maximum number of seconds celerybeat is allowed to sleep between
  111. checking the schedule. The default is 5 minutes, which means celerybeat can
  112. only sleep a maximum of 5 minutes after checking the schedule run-times for a
  113. periodic task to apply. If you change the run_times of periodic tasks at
  114. run-time, you may consider lowering this value for changes to take effect
  115. faster (A value of 5 minutes, means the changes will take effect in 5 minutes
  116. at maximum).
  117. .. data:: CELERYMON_LOG_LEVEL
  118. Default log level for celerymon.
  119. Default is: ``INFO``.
  120. .. data:: CELERYMON_LOG_FILE
  121. Default log file for celerymon.
  122. Default is: ``None`` (stderr)
  123. .. data:: LOG_LEVELS
  124. Mapping of log level names to :mod:`logging` module constants.
  125. .. data:: CELERYD_LOG_FORMAT
  126. The format to use for log messages.
  127. .. data:: CELERYD_TASK_LOG_FORMAT
  128. The format to use for task log messages.
  129. .. data:: CELERYD_LOG_FILE
  130. Filename of the daemon log file.
  131. Default is: ``None`` (stderr)
  132. .. data:: CELERYD_LOG_LEVEL
  133. Default log level for daemons. (``WARN``)
  134. .. data:: CELERYD_CONCURRENCY
  135. The number of concurrent worker processes.
  136. If set to ``0``, the total number of available CPUs/cores will be used.
  137. .. data:: CELERYD_PREFETCH_MULTIPLIER
  138. The number of concurrent workers is multipled by this number to yield
  139. the wanted AMQP QoS message prefetch count.
  140. .. data:: CELERYD_POOL
  141. Name of the task pool class used by the worker.
  142. Default is ``"celery.concurrency.processes.TaskPool"``.
  143. .. data:: CELERYD_LISTENER
  144. Name of the listener class used by the worker.
  145. Default is ``"celery.worker.listener.CarrotListener"``.
  146. .. data:: CELERYD_MEDIATOR
  147. Name of the mediator class used by the worker.
  148. Default is ``"celery.worker.controllers.Mediator"``.
  149. .. data:: CELERYD_ETA_SCHEDULER
  150. Name of the ETA scheduler class used by the worker.
  151. Default is ``"celery.worker.controllers.ScheduleController"``.