celery.conf.rst 7.0 KB

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