celery.conf.rst 6.4 KB

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