configuration.rst 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502
  1. .. _configuration:
  2. ============================
  3. Configuration and defaults
  4. ============================
  5. This document describes the configuration options available.
  6. If you're using the default loader, you must create the :file:`celeryconfig.py`
  7. module and make sure it is available on the Python path.
  8. .. contents::
  9. :local:
  10. :depth: 2
  11. .. _conf-example:
  12. Example configuration file
  13. ==========================
  14. This is an example configuration file to get you started.
  15. It should contain all you need to run a basic Celery set-up.
  16. .. code-block:: python
  17. ## Broker settings.
  18. BROKER_URL = "amqp://guest:guest@localhost:5672//"
  19. # List of modules to import when celery starts.
  20. CELERY_IMPORTS = ("myapp.tasks", )
  21. ## Using the database to store task state and results.
  22. CELERY_RESULT_BACKEND = "database"
  23. CELERY_RESULT_DBURI = "sqlite:///mydatabase.db"
  24. CELERY_ANNOTATIONS = {"tasks.add": {"rate_limit": "10/s"}}
  25. Configuration Directives
  26. ========================
  27. .. _conf-datetime:
  28. Time and date settings
  29. ----------------------
  30. .. setting:: CELERY_ENABLE_UTC
  31. CELERY_ENABLE_UTC
  32. ~~~~~~~~~~~~~~~~~
  33. If enabled dates and times in messages will be converted to use
  34. the UTC timezone.
  35. Note that workers running Celery versions below 2.5 will assume a local
  36. timezone for all messages, so only enable if all workers have been
  37. upgraded.
  38. Disabled by default. UTC will be enabled by default in version 4.0.
  39. .. setting:: CELERY_TIMEZONE
  40. CELERY_TIMEZONE
  41. ---------------
  42. Configure Celery to use a custom time zone.
  43. The timezone value can be any time zone supported by the :mod:`pytz`
  44. library. :mod:`pytz` must be installed for the selected zone
  45. to be used.
  46. If not set then the systems default local time zone is used.
  47. .. warning::
  48. Celery requires the :mod:`pytz` library to be installed,
  49. when using custom time zones (other than UTC). You can
  50. install it using :program:`pip` or :program:`easy_install`::
  51. $ pip install pytz
  52. Pytz is a library that defines the timzones of the world,
  53. it changes quite frequently so it is not included in the Python Standard
  54. Library.
  55. .. _conf-tasks:
  56. Task settings
  57. -------------
  58. .. setting:: CELERY_ANNOTATIONS
  59. CELERY_ANNOTATIONS
  60. ~~~~~~~~~~~~~~~~~~
  61. This setting can be used to rewrite any task attribute from the
  62. configuration. The setting can be a dict, or a list of annotation
  63. objects that filter for tasks and return a map of attributes
  64. to change.
  65. This will change the ``rate_limit`` attribute for the ``tasks.add``
  66. task:
  67. .. code-block:: python
  68. CELERY_ANNOTATIONS = {"tasks.add": {"rate_limit": "10/s"}}
  69. or change the same for all tasks:
  70. .. code-block:: python
  71. CELERY_ANNOTATIONS = {"*": {"rate_limit": "10/s"}}
  72. You can change methods too, for example the ``on_failure`` handler:
  73. .. code-block:: python
  74. def my_on_failure(self, exc, task_id, args, kwargs, einfo):
  75. print("Oh no! Task failed: %r" % (exc, ))
  76. CELERY_ANNOTATIONS = {"*": {"on_failure": my_on_failure}}
  77. If you need more flexibility then you can use objects
  78. instead of a dict to choose which tasks to annotate:
  79. .. code-block:: python
  80. class MyAnnotate(object):
  81. def annotate(self, task):
  82. if task.name.startswith("tasks."):
  83. return {"rate_limit": "10/s"}
  84. CELERY_ANNOTATIONS = (MyAnnotate(), {...})
  85. .. _conf-concurrency:
  86. Concurrency settings
  87. --------------------
  88. .. setting:: CELERYD_CONCURRENCY
  89. CELERYD_CONCURRENCY
  90. ~~~~~~~~~~~~~~~~~~~
  91. The number of concurrent worker processes/threads/green threads executing
  92. tasks.
  93. If you're doing mostly I/O you can have more processes,
  94. but if mostly CPU-bound, try to keep it close to the
  95. number of CPUs on your machine. If not set, the number of CPUs/cores
  96. on the host will be used.
  97. Defaults to the number of available CPUs.
  98. .. setting:: CELERYD_PREFETCH_MULTIPLIER
  99. CELERYD_PREFETCH_MULTIPLIER
  100. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  101. How many messages to prefetch at a time multiplied by the number of
  102. concurrent processes. The default is 4 (four messages for each
  103. process). The default setting is usually a good choice, however -- if you
  104. have very long running tasks waiting in the queue and you have to start the
  105. workers, note that the first worker to start will receive four times the
  106. number of messages initially. Thus the tasks may not be fairly distributed
  107. to the workers.
  108. .. _conf-result-backend:
  109. Task result backend settings
  110. ----------------------------
  111. .. setting:: CELERY_RESULT_BACKEND
  112. CELERY_RESULT_BACKEND
  113. ~~~~~~~~~~~~~~~~~~~~~
  114. :Deprecated aliases: ``CELERY_BACKEND``
  115. The backend used to store task results (tombstones).
  116. Disabled by default.
  117. Can be one of the following:
  118. * database
  119. Use a relational database supported by `SQLAlchemy`_.
  120. See :ref:`conf-database-result-backend`.
  121. * cache
  122. Use `memcached`_ to store the results.
  123. See :ref:`conf-cache-result-backend`.
  124. * mongodb
  125. Use `MongoDB`_ to store the results.
  126. See :ref:`conf-mongodb-result-backend`.
  127. * redis
  128. Use `Redis`_ to store the results.
  129. See :ref:`conf-redis-result-backend`.
  130. * amqp
  131. Send results back as AMQP messages
  132. See :ref:`conf-amqp-result-backend`.
  133. * cassandra
  134. Use `Cassandra`_ to store the results.
  135. See :ref:`conf-cassandra-result-backend`.
  136. .. warning:
  137. While the AMQP result backend is very efficient, you must make sure
  138. you only receive the same result once. See :doc:`userguide/calling`).
  139. .. _`SQLAlchemy`: http://sqlalchemy.org
  140. .. _`memcached`: http://memcached.org
  141. .. _`MongoDB`: http://mongodb.org
  142. .. _`Redis`: http://code.google.com/p/redis/
  143. .. _`Cassandra`: http://cassandra.apache.org/
  144. .. setting:: CELERY_RESULT_SERIALIZER
  145. CELERY_RESULT_SERIALIZER
  146. ~~~~~~~~~~~~~~~~~~~~~~~~
  147. Result serialization format. Default is `"pickle"`. See
  148. :ref:`calling-serializers` for information about supported
  149. serialization formats.
  150. .. _conf-database-result-backend:
  151. Database backend settings
  152. -------------------------
  153. .. setting:: CELERY_RESULT_DBURI
  154. CELERY_RESULT_DBURI
  155. ~~~~~~~~~~~~~~~~~~~
  156. Please see `Supported Databases`_ for a table of supported databases.
  157. To use this backend you need to configure it with an
  158. `Connection String`_, some examples include:
  159. .. code-block:: python
  160. # sqlite (filename)
  161. CELERY_RESULT_DBURI = "sqlite:///celerydb.sqlite"
  162. # mysql
  163. CELERY_RESULT_DBURI = "mysql://scott:tiger@localhost/foo"
  164. # postgresql
  165. CELERY_RESULT_DBURI = "postgresql://scott:tiger@localhost/mydatabase"
  166. # oracle
  167. CELERY_RESULT_DBURI = "oracle://scott:tiger@127.0.0.1:1521/sidname"
  168. See `Connection String`_ for more information about connection
  169. strings.
  170. .. setting:: CELERY_RESULT_ENGINE_OPTIONS
  171. CELERY_RESULT_ENGINE_OPTIONS
  172. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  173. To specify additional SQLAlchemy database engine options you can use
  174. the :setting:`CELERY_RESULT_ENGINE_OPTIONS` setting::
  175. # echo enables verbose logging from SQLAlchemy.
  176. CELERY_RESULT_ENGINE_OPTIONS = {"echo": True}
  177. .. setting:: CELERY_RESULT_DB_SHORT_LIVED_SESSIONS
  178. CELERY_RESULT_DB_SHORT_LIVED_SESSIONS = True
  179. Short lived sessions are disabled by default. If enabled they can drastically reduce
  180. performance, especially on systems processing lots of tasks. This option is useful
  181. on low-traffic workers that experience errors as a result of cached database connections
  182. going stale through inactivity. For example, intermittent errors like
  183. `(OperationalError) (2006, 'MySQL server has gone away')` can be fixed by enabling
  184. short lived sessions. This option only affects the database backend.
  185. .. _`Supported Databases`:
  186. http://www.sqlalchemy.org/docs/core/engines.html#supported-databases
  187. .. _`Connection String`:
  188. http://www.sqlalchemy.org/docs/core/engines.html#database-urls
  189. Example configuration
  190. ~~~~~~~~~~~~~~~~~~~~~
  191. .. code-block:: python
  192. CELERY_RESULT_BACKEND = "database"
  193. CELERY_RESULT_DBURI = "mysql://user:password@host/dbname"
  194. .. _conf-amqp-result-backend:
  195. AMQP backend settings
  196. ---------------------
  197. .. note::
  198. The AMQP backend requires RabbitMQ 1.1.0 or higher to automatically
  199. expire results. If you are running an older version of RabbitmQ
  200. you should disable result expiration like this:
  201. CELERY_TASK_RESULT_EXPIRES = None
  202. .. setting:: CELERY_RESULT_EXCHANGE
  203. CELERY_RESULT_EXCHANGE
  204. ~~~~~~~~~~~~~~~~~~~~~~
  205. Name of the exchange to publish results in. Default is `"celeryresults"`.
  206. .. setting:: CELERY_RESULT_EXCHANGE_TYPE
  207. CELERY_RESULT_EXCHANGE_TYPE
  208. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  209. The exchange type of the result exchange. Default is to use a `direct`
  210. exchange.
  211. .. setting:: CELERY_RESULT_PERSISTENT
  212. CELERY_RESULT_PERSISTENT
  213. ~~~~~~~~~~~~~~~~~~~~~~~~
  214. If set to :const:`True`, result messages will be persistent. This means the
  215. messages will not be lost after a broker restart. The default is for the
  216. results to be transient.
  217. Example configuration
  218. ~~~~~~~~~~~~~~~~~~~~~
  219. .. code-block:: python
  220. CELERY_RESULT_BACKEND = "amqp"
  221. CELERY_TASK_RESULT_EXPIRES = 18000 # 5 hours.
  222. .. _conf-cache-result-backend:
  223. Cache backend settings
  224. ----------------------
  225. .. note::
  226. The cache backend supports the `pylibmc`_ and `python-memcached`
  227. libraries. The latter is used only if `pylibmc`_ is not installed.
  228. .. setting:: CELERY_CACHE_BACKEND
  229. CELERY_CACHE_BACKEND
  230. ~~~~~~~~~~~~~~~~~~~~
  231. Using a single memcached server:
  232. .. code-block:: python
  233. CELERY_CACHE_BACKEND = 'memcached://127.0.0.1:11211/'
  234. Using multiple memcached servers:
  235. .. code-block:: python
  236. CELERY_RESULT_BACKEND = "cache"
  237. CELERY_CACHE_BACKEND = 'memcached://172.19.26.240:11211;172.19.26.242:11211/'
  238. .. setting:: CELERY_CACHE_BACKEND_OPTIONS
  239. The "dummy" backend stores the cache in memory only:
  240. CELERY_CACHE_BACKEND = "dummy"
  241. CELERY_CACHE_BACKEND_OPTIONS
  242. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  243. You can set pylibmc options using the :setting:`CELERY_CACHE_BACKEND_OPTIONS`
  244. setting:
  245. .. code-block:: python
  246. CELERY_CACHE_BACKEND_OPTIONS = {"binary": True,
  247. "behaviors": {"tcp_nodelay": True}}
  248. .. _`pylibmc`: http://sendapatch.se/projects/pylibmc/
  249. .. _conf-redis-result-backend:
  250. Redis backend settings
  251. ----------------------
  252. Configuring the backend URL
  253. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  254. .. note::
  255. The Redis backend requires the :mod:`redis` library:
  256. http://pypi.python.org/pypi/redis/
  257. To install the redis package use `pip` or `easy_install`::
  258. $ pip install redis
  259. This backend requires the :setting:`CELERY_RESULT_BACKEND`
  260. setting to be set to a Redis URL::
  261. CELERY_RESULT_BACKEND = "redis://:password@host:port/db"
  262. For example::
  263. CELERY_RESULT_BACKEND = "redis://localhost/0"
  264. which is the same as::
  265. CELERY_RESULT_BACKEND = "redis://"
  266. The fields of the URL is defined as folows:
  267. - *host*
  268. Host name or IP address of the Redis server. e.g. `"localhost"`.
  269. - *port*
  270. Port to the Redis server. Default is 6379.
  271. - *db*
  272. Database number to use. Default is 0.
  273. The db can include an optional leading slash.
  274. - *password*
  275. Password used to connect to the database.
  276. .. setting:: CELERY_REDIS_MAX_CONNECTIONS
  277. CELERY_REDIS_MAX_CONNECTIONS
  278. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  279. Maximum number of connections available in the Redis connection
  280. pool used for sending and retrieving results.
  281. .. _conf-mongodb-result-backend:
  282. MongoDB backend settings
  283. ------------------------
  284. .. note::
  285. The MongoDB backend requires the :mod:`pymongo` library:
  286. http://github.com/mongodb/mongo-python-driver/tree/master
  287. .. setting:: CELERY_MONGODB_BACKEND_SETTINGS
  288. CELERY_MONGODB_BACKEND_SETTINGS
  289. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  290. This is a dict supporting the following keys:
  291. * host
  292. Host name of the MongoDB server. Defaults to "localhost".
  293. * port
  294. The port the MongoDB server is listening to. Defaults to 27017.
  295. * user
  296. User name to authenticate to the MongoDB server as (optional).
  297. * password
  298. Password to authenticate to the MongoDB server (optional).
  299. * database
  300. The database name to connect to. Defaults to "celery".
  301. * taskmeta_collection
  302. The collection name to store task meta data.
  303. Defaults to "celery_taskmeta".
  304. .. _example-mongodb-result-config:
  305. Example configuration
  306. ~~~~~~~~~~~~~~~~~~~~~
  307. .. code-block:: python
  308. CELERY_RESULT_BACKEND = "mongodb"
  309. CELERY_MONGODB_BACKEND_SETTINGS = {
  310. "host": "192.168.1.100",
  311. "port": 30000,
  312. "database": "mydb",
  313. "taskmeta_collection": "my_taskmeta_collection",
  314. }
  315. .. _conf-cassandra-result-backend:
  316. Cassandra backend settings
  317. --------------------------
  318. .. note::
  319. The Cassandra backend requires the :mod:`pycassa` library:
  320. http://pypi.python.org/pypi/pycassa/
  321. To install the pycassa package use `pip` or `easy_install`::
  322. $ pip install pycassa
  323. This backend requires the following configuration directives to be set.
  324. .. setting:: CASSANDRA_SERVERS
  325. CASSANDRA_SERVERS
  326. ~~~~~~~~~~~~~~~~~
  327. List of ``host:port`` Cassandra servers. e.g. ``["localhost:9160]"``.
  328. .. setting:: CASSANDRA_KEYSPACE
  329. CASSANDRA_KEYSPACE
  330. ~~~~~~~~~~~~~~~~~~
  331. The keyspace in which to store the results. e.g. ``"tasks_keyspace"``.
  332. .. setting:: CASSANDRA_COLUMN_FAMILY
  333. CASSANDRA_COLUMN_FAMILY
  334. ~~~~~~~~~~~~~~~~~~~~~~~
  335. The column family in which to store the results. eg ``"tasks"``
  336. .. setting:: CASSANDRA_READ_CONSISTENCY
  337. CASSANDRA_READ_CONSISTENCY
  338. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  339. The read consistency used. Values can be ``"ONE"``, ``"QUORUM"`` or ``"ALL"``.
  340. .. setting:: CASSANDRA_WRITE_CONSISTENCY
  341. CASSANDRA_WRITE_CONSISTENCY
  342. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  343. The write consistency used. Values can be ``"ONE"``, ``"QUORUM"`` or ``"ALL"``.
  344. .. setting:: CASSANDRA_DETAILED_MODE
  345. CASSANDRA_DETAILED_MODE
  346. ~~~~~~~~~~~~~~~~~~~~~~~
  347. Enable or disable detailed mode. Default is :const:`False`.
  348. This mode allows to use the power of Cassandra wide columns to
  349. store all states for a task as a wide column, instead of only the last one.
  350. To use this mode, you need to configure your ColumnFamily to
  351. use the ``TimeUUID`` type as a comparator::
  352. create column family task_results with comparator = TimeUUIDType;
  353. Example configuration
  354. ~~~~~~~~~~~~~~~~~~~~~
  355. .. code-block:: python
  356. CASSANDRA_SERVERS = ["localhost:9160"]
  357. CASSANDRA_KEYSPACE = "celery"
  358. CASSANDRA_COLUMN_FAMILY = "task_results"
  359. CASSANDRA_READ_CONSISTENCY = "ONE"
  360. CASSANDRA_WRITE_CONSISTENCY = "ONE"
  361. CASSANDRA_DETAILED_MODE = True
  362. .. _conf-messaging:
  363. Message Routing
  364. ---------------
  365. .. _conf-messaging-routing:
  366. .. setting:: CELERY_QUEUES
  367. CELERY_QUEUES
  368. ~~~~~~~~~~~~~
  369. The mapping of queues the worker consumes from. This is a dictionary
  370. of queue name/options. See :ref:`guide-routing` for more information.
  371. The default is a queue/exchange/binding key of `"celery"`, with
  372. exchange type `direct`.
  373. You don't have to care about this unless you want custom routing facilities.
  374. .. setting:: CELERY_ROUTES
  375. CELERY_ROUTES
  376. ~~~~~~~~~~~~~
  377. A list of routers, or a single router used to route tasks to queues.
  378. When deciding the final destination of a task the routers are consulted
  379. in order. See :ref:`routers` for more information.
  380. .. setting:: CELERY_CREATE_MISSING_QUEUES
  381. CELERY_CREATE_MISSING_QUEUES
  382. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  383. If enabled (default), any queues specified that is not defined in
  384. :setting:`CELERY_QUEUES` will be automatically created. See
  385. :ref:`routing-automatic`.
  386. .. setting:: CELERY_DEFAULT_QUEUE
  387. CELERY_DEFAULT_QUEUE
  388. ~~~~~~~~~~~~~~~~~~~~
  389. The name of the default queue used by `.apply_async` if the message has
  390. no route or no custom queue has been specified.
  391. This queue must be listed in :setting:`CELERY_QUEUES`.
  392. If :setting:`CELERY_QUEUES` is not specified then it this automatically
  393. created containing one queue entry, where this name is used as the name of
  394. that queue.
  395. The default is: `celery`.
  396. .. seealso::
  397. :ref:`routing-changing-default-queue`
  398. .. setting:: CELERY_DEFAULT_EXCHANGE
  399. CELERY_DEFAULT_EXCHANGE
  400. ~~~~~~~~~~~~~~~~~~~~~~~
  401. Name of the default exchange to use when no custom exchange is
  402. specified for a key in the :setting:`CELERY_QUEUES` setting.
  403. The default is: `celery`.
  404. .. setting:: CELERY_DEFAULT_EXCHANGE_TYPE
  405. CELERY_DEFAULT_EXCHANGE_TYPE
  406. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  407. Default exchange type used when no custom exchange type is specified.
  408. for a key in the :setting:`CELERY_QUEUES` setting.
  409. The default is: `direct`.
  410. .. setting:: CELERY_DEFAULT_ROUTING_KEY
  411. CELERY_DEFAULT_ROUTING_KEY
  412. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  413. The default routing key used when no custom routing key
  414. is specified for a key in the :setting:`CELERY_QUEUES` setting.
  415. The default is: `celery`.
  416. .. setting:: CELERY_DEFAULT_DELIVERY_MODE
  417. CELERY_DEFAULT_DELIVERY_MODE
  418. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  419. Can be `transient` or `persistent`. The default is to send
  420. persistent messages.
  421. .. _conf-broker-settings:
  422. Broker Settings
  423. ---------------
  424. .. setting:: BROKER_TRANSPORT
  425. BROKER_TRANSPORT
  426. ~~~~~~~~~~~~~~~~
  427. :Aliases: ``BROKER_BACKEND``
  428. :Deprecated aliases: ``CARROT_BACKEND``
  429. .. setting:: BROKER_URL
  430. BROKER_URL
  431. ~~~~~~~~~~
  432. Default broker URL. This must be an URL in the form of::
  433. transport://userid:password@hostname:port/virtual_host
  434. Only the scheme part (``transport://``) is required, the rest
  435. is optional, and defaults to the specific transports default values.
  436. The transport part is the broker implementation to use, and the
  437. default is ``amqp``, but there are many other choices including
  438. ``librabbitmq``, ``amqplib``, ``redis``, ``beanstalk``,
  439. ``sqlalchemy``, ``django``, ``mongodb``, ``couchdb`` and ``pika``.
  440. It can also be a fully qualified path to your own transport implementation.
  441. See the Kombu documentation for more information about broker URLs.
  442. .. setting:: BROKER_USE_SSL
  443. BROKER_USE_SSL
  444. ~~~~~~~~~~~~~~
  445. Use SSL to connect to the broker. Off by default. This may not be supported
  446. by all transports.
  447. .. setting:: BROKER_POOL_LIMIT
  448. BROKER_POOL_LIMIT
  449. ~~~~~~~~~~~~~~~~~
  450. .. versionadded:: 2.3
  451. The maximum number of connections that can be open in the connection pool.
  452. The pool is enabled by default since version 2.5, with a default limit of ten
  453. connections. This number can be tweaked depending on the number of
  454. threads/greenthreads (eventlet/gevent) using a connection. For example
  455. running eventlet with 1000 greenlets that use a connection to the broker,
  456. contention can arise and you should consider increasing the limit.
  457. If set to :const:`None` or 0 the connection pool will be disabled and
  458. connections will be established and closed for every use.
  459. Default (since 2.5) is to use a pool of 10 connections.
  460. .. setting:: BROKER_CONNECTION_TIMEOUT
  461. BROKER_CONNECTION_TIMEOUT
  462. ~~~~~~~~~~~~~~~~~~~~~~~~~
  463. The default timeout in seconds before we give up establishing a connection
  464. to the AMQP server. Default is 4 seconds.
  465. .. setting:: BROKER_CONNECTION_RETRY
  466. BROKER_CONNECTION_RETRY
  467. ~~~~~~~~~~~~~~~~~~~~~~~
  468. Automatically try to re-establish the connection to the AMQP broker if lost.
  469. The time between retries is increased for each retry, and is
  470. not exhausted before :setting:`BROKER_CONNECTION_MAX_RETRIES` is
  471. exceeded.
  472. This behavior is on by default.
  473. .. setting:: BROKER_CONNECTION_MAX_RETRIES
  474. BROKER_CONNECTION_MAX_RETRIES
  475. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  476. Maximum number of retries before we give up re-establishing a connection
  477. to the AMQP broker.
  478. If this is set to :const:`0` or :const:`None`, we will retry forever.
  479. Default is 100 retries.
  480. .. setting:: BROKER_TRANSPORT_OPTIONS
  481. BROKER_TRANSPORT_OPTIONS
  482. ~~~~~~~~~~~~~~~~~~~~~~~~
  483. .. versionadded:: 2.2
  484. A dict of additional options passed to the underlying transport.
  485. See your transport user manual for supported options (if any).
  486. .. _conf-task-execution:
  487. Task execution settings
  488. -----------------------
  489. .. setting:: CELERY_ALWAYS_EAGER
  490. CELERY_ALWAYS_EAGER
  491. ~~~~~~~~~~~~~~~~~~~
  492. If this is :const:`True`, all tasks will be executed locally by blocking until
  493. the task returns. ``apply_async()`` and ``Task.delay()`` will return
  494. an :class:`~celery.result.EagerResult` instance, which emulates the API
  495. and behavior of :class:`~celery.result.AsyncResult`, except the result
  496. is already evaluated.
  497. That is, tasks will be executed locally instead of being sent to
  498. the queue.
  499. .. setting:: CELERY_EAGER_PROPAGATES_EXCEPTIONS
  500. CELERY_EAGER_PROPAGATES_EXCEPTIONS
  501. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  502. If this is :const:`True`, eagerly executed tasks (applied by `task.apply()`,
  503. or when the :setting:`CELERY_ALWAYS_EAGER` setting is enabled), will
  504. propagate exceptions.
  505. It's the same as always running ``apply()`` with ``throw=True``.
  506. .. setting:: CELERY_IGNORE_RESULT
  507. CELERY_IGNORE_RESULT
  508. ~~~~~~~~~~~~~~~~~~~~
  509. Whether to store the task return values or not (tombstones).
  510. If you still want to store errors, just not successful return values,
  511. you can set :setting:`CELERY_STORE_ERRORS_EVEN_IF_IGNORED`.
  512. .. setting:: CELERY_MESSAGE_COMPRESSION
  513. CELERY_MESSAGE_COMPRESSION
  514. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  515. Default compression used for task messages.
  516. Can be ``"gzip"``, ``"bzip2"`` (if available), or any custom
  517. compression schemes registered in the Kombu compression registry.
  518. The default is to send uncompressed messages.
  519. .. setting:: CELERY_TASK_RESULT_EXPIRES
  520. CELERY_TASK_RESULT_EXPIRES
  521. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  522. Time (in seconds, or a :class:`~datetime.timedelta` object) for when after
  523. stored task tombstones will be deleted.
  524. A built-in periodic task will delete the results after this time
  525. (:class:`celery.task.backend_cleanup`).
  526. .. note::
  527. For the moment this only works with the amqp, database, cache, redis and MongoDB
  528. backends.
  529. When using the database or MongoDB backends, `celerybeat` must be
  530. running for the results to be expired.
  531. .. setting:: CELERY_MAX_CACHED_RESULTS
  532. CELERY_MAX_CACHED_RESULTS
  533. ~~~~~~~~~~~~~~~~~~~~~~~~~
  534. Result backends caches ready results used by the client.
  535. This is the total number of results to cache before older results are evicted.
  536. The default is 5000.
  537. .. setting:: CELERY_TRACK_STARTED
  538. CELERY_TRACK_STARTED
  539. ~~~~~~~~~~~~~~~~~~~~
  540. If :const:`True` the task will report its status as "started" when the
  541. task is executed by a worker. The default value is :const:`False` as
  542. the normal behaviour is to not report that level of granularity. Tasks
  543. are either pending, finished, or waiting to be retried. Having a "started"
  544. state can be useful for when there are long running tasks and there is a
  545. need to report which task is currently running.
  546. .. setting:: CELERY_TASK_SERIALIZER
  547. CELERY_TASK_SERIALIZER
  548. ~~~~~~~~~~~~~~~~~~~~~~
  549. A string identifying the default serialization method to use. Can be
  550. `pickle` (default), `json`, `yaml`, `msgpack` or any custom serialization
  551. methods that have been registered with :mod:`kombu.serialization.registry`.
  552. .. seealso::
  553. :ref:`calling-serializers`.
  554. .. setting:: CELERY_TASK_PUBLISH_RETRY
  555. CELERY_TASK_PUBLISH_RETRY
  556. ~~~~~~~~~~~~~~~~~~~~~~~~~
  557. .. versionadded:: 2.2
  558. Decides if publishing task messages will be retried in the case
  559. of connection loss or other connection errors.
  560. See also :setting:`CELERY_TASK_PUBLISH_RETRY_POLICY`.
  561. Disabled by default.
  562. .. setting:: CELERY_TASK_PUBLISH_RETRY_POLICY
  563. CELERY_TASK_PUBLISH_RETRY_POLICY
  564. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  565. .. versionadded:: 2.2
  566. Defines the default policy when retrying publishing a task message in
  567. the case of connection loss or other connection errors.
  568. See :ref:`calling-retry` for more information.
  569. .. setting:: CELERY_DEFAULT_RATE_LIMIT
  570. CELERY_DEFAULT_RATE_LIMIT
  571. ~~~~~~~~~~~~~~~~~~~~~~~~~
  572. The global default rate limit for tasks.
  573. This value is used for tasks that does not have a custom rate limit
  574. The default is no rate limit.
  575. .. setting:: CELERY_DISABLE_RATE_LIMITS
  576. CELERY_DISABLE_RATE_LIMITS
  577. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  578. Disable all rate limits, even if tasks has explicit rate limits set.
  579. .. setting:: CELERY_ACKS_LATE
  580. CELERY_ACKS_LATE
  581. ~~~~~~~~~~~~~~~~
  582. Late ack means the task messages will be acknowledged **after** the task
  583. has been executed, not *just before*, which is the default behavior.
  584. .. seealso::
  585. FAQ: :ref:`faq-acks_late-vs-retry`.
  586. .. _conf-celeryd:
  587. Worker: celeryd
  588. ---------------
  589. .. setting:: CELERY_IMPORTS
  590. CELERY_IMPORTS
  591. ~~~~~~~~~~~~~~
  592. A sequence of modules to import when the celery daemon starts.
  593. This is used to specify the task modules to import, but also
  594. to import signal handlers and additional remote control commands, etc.
  595. .. setting:: CELERY_INCLUDE
  596. CELERY_INCLUDE
  597. ~~~~~~~~~~~~~~
  598. Exact same semantics as :setting:`CELERY_IMPORTS`, but can be used as a means
  599. to have different import categories.
  600. .. setting:: CELERYD_FORCE_EXECV
  601. CELERYD_FORCE_EXECV
  602. ~~~~~~~~~~~~~~~~~~~
  603. On Unix the processes pool will fork, so that child processes
  604. start with the same memory as the parent process.
  605. This can cause problems as there is a known deadlock condition
  606. with pthread locking primitives when `fork()` is combined with threads.
  607. You should enable this setting if you are experiencing hangs (deadlocks),
  608. especially in combination with time limits or having a max tasks per child limit.
  609. This option will be enabled by default in a later version.
  610. This is not a problem on Windows, as it does not have `fork()`.
  611. .. setting:: CELERYD_WORKER_LOST_WAIT
  612. CELERYD_WORKER_LOST_WAIT
  613. ~~~~~~~~~~~~~~~~~~~~~~~~
  614. In some cases a worker may be killed without proper cleanup,
  615. and the worker may have published a result before terminating.
  616. This value specifies how long we wait for any missing results before
  617. raising a :exc:`@WorkerLostError` exception.
  618. Default is 10.0
  619. .. setting:: CELERYD_MAX_TASKS_PER_CHILD
  620. CELERYD_MAX_TASKS_PER_CHILD
  621. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  622. Maximum number of tasks a pool worker process can execute before
  623. it's replaced with a new one. Default is no limit.
  624. .. setting:: CELERYD_TASK_TIME_LIMIT
  625. CELERYD_TASK_TIME_LIMIT
  626. ~~~~~~~~~~~~~~~~~~~~~~~
  627. Task hard time limit in seconds. The worker processing the task will
  628. be killed and replaced with a new one when this is exceeded.
  629. .. setting:: CELERYD_TASK_SOFT_TIME_LIMIT
  630. CELERYD_TASK_SOFT_TIME_LIMIT
  631. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  632. Task soft time limit in seconds.
  633. The :exc:`~@SoftTimeLimitExceeded` exception will be
  634. raised when this is exceeded. The task can catch this to
  635. e.g. clean up before the hard time limit comes.
  636. Example:
  637. .. code-block:: python
  638. from celery.exceptions import SoftTimeLimitExceeded
  639. @celery.task()
  640. def mytask():
  641. try:
  642. return do_work()
  643. except SoftTimeLimitExceeded:
  644. cleanup_in_a_hurry()
  645. .. setting:: CELERY_STORE_ERRORS_EVEN_IF_IGNORED
  646. CELERY_STORE_ERRORS_EVEN_IF_IGNORED
  647. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  648. If set, the worker stores all task errors in the result store even if
  649. :attr:`Task.ignore_result <celery.task.base.Task.ignore_result>` is on.
  650. .. setting:: CELERYD_STATE_DB
  651. CELERYD_STATE_DB
  652. ~~~~~~~~~~~~~~~~
  653. Name of the file used to stores persistent worker state (like revoked tasks).
  654. Can be a relative or absolute path, but be aware that the suffix `.db`
  655. may be appended to the file name (depending on Python version).
  656. Can also be set via the :option:`--statedb` argument to
  657. :mod:`~celery.bin.celeryd`.
  658. Not enabled by default.
  659. .. setting:: CELERYD_TIMER_PRECISION
  660. CELERYD_TIMER_PRECISION
  661. ~~~~~~~~~~~~~~~~~~~~~~~
  662. Set the maximum time in seconds that the ETA scheduler can sleep between
  663. rechecking the schedule. Default is 1 second.
  664. Setting this value to 1 second means the schedulers precision will
  665. be 1 second. If you need near millisecond precision you can set this to 0.1.
  666. .. _conf-error-mails:
  667. Error E-Mails
  668. -------------
  669. .. setting:: CELERY_SEND_TASK_ERROR_EMAILS
  670. CELERY_SEND_TASK_ERROR_EMAILS
  671. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  672. The default value for the `Task.send_error_emails` attribute, which if
  673. set to :const:`True` means errors occurring during task execution will be
  674. sent to :setting:`ADMINS` by email.
  675. Disabled by default.
  676. .. setting:: ADMINS
  677. ADMINS
  678. ~~~~~~
  679. List of `(name, email_address)` tuples for the administrators that should
  680. receive error emails.
  681. .. setting:: SERVER_EMAIL
  682. SERVER_EMAIL
  683. ~~~~~~~~~~~~
  684. The email address this worker sends emails from.
  685. Default is celery@localhost.
  686. .. setting:: EMAIL_HOST
  687. EMAIL_HOST
  688. ~~~~~~~~~~
  689. The mail server to use. Default is `"localhost"`.
  690. .. setting:: EMAIL_HOST_USER
  691. EMAIL_HOST_USER
  692. ~~~~~~~~~~~~~~~
  693. User name (if required) to log on to the mail server with.
  694. .. setting:: EMAIL_HOST_PASSWORD
  695. EMAIL_HOST_PASSWORD
  696. ~~~~~~~~~~~~~~~~~~~
  697. Password (if required) to log on to the mail server with.
  698. .. setting:: EMAIL_PORT
  699. EMAIL_PORT
  700. ~~~~~~~~~~
  701. The port the mail server is listening on. Default is `25`.
  702. .. setting:: EMAIL_USE_SSL
  703. EMAIL_USE_SSL
  704. ~~~~~~~~~~~~~
  705. Use SSL when connecting to the SMTP server. Disabled by default.
  706. .. setting:: EMAIL_USE_TLS
  707. EMAIL_USE_TLS
  708. ~~~~~~~~~~~~~
  709. Use TLS when connecting to the SMTP server. Disabled by default.
  710. .. setting:: EMAIL_TIMEOUT
  711. EMAIL_TIMEOUT
  712. ~~~~~~~~~~~~~
  713. Timeout in seconds for when we give up trying to connect
  714. to the SMTP server when sending emails.
  715. The default is 2 seconds.
  716. .. _conf-example-error-mail-config:
  717. Example E-Mail configuration
  718. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  719. This configuration enables the sending of error emails to
  720. george@vandelay.com and kramer@vandelay.com:
  721. .. code-block:: python
  722. # Enables error emails.
  723. CELERY_SEND_TASK_ERROR_EMAILS = True
  724. # Name and email addresses of recipients
  725. ADMINS = (
  726. ("George Costanza", "george@vandelay.com"),
  727. ("Cosmo Kramer", "kosmo@vandelay.com"),
  728. )
  729. # Email address used as sender (From field).
  730. SERVER_EMAIL = "no-reply@vandelay.com"
  731. # Mailserver configuration
  732. EMAIL_HOST = "mail.vandelay.com"
  733. EMAIL_PORT = 25
  734. # EMAIL_HOST_USER = "servers"
  735. # EMAIL_HOST_PASSWORD = "s3cr3t"
  736. .. _conf-events:
  737. Events
  738. ------
  739. .. setting:: CELERY_SEND_EVENTS
  740. CELERY_SEND_EVENTS
  741. ~~~~~~~~~~~~~~~~~~
  742. Send events so the worker can be monitored by tools like `celerymon`.
  743. .. setting:: CELERY_SEND_TASK_SENT_EVENT
  744. CELERY_SEND_TASK_SENT_EVENT
  745. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  746. .. versionadded:: 2.2
  747. If enabled, a `task-sent` event will be sent for every task so tasks can be
  748. tracked before they are consumed by a worker.
  749. Disabled by default.
  750. .. setting:: CELERY_EVENT_SERIALIZER
  751. CELERY_EVENT_SERIALIZER
  752. ~~~~~~~~~~~~~~~~~~~~~~~
  753. Message serialization format used when sending event messages.
  754. Default is `"json"`. See :ref:`calling-serializers`.
  755. .. _conf-broadcast:
  756. Broadcast Commands
  757. ------------------
  758. .. setting:: CELERY_BROADCAST_QUEUE
  759. CELERY_BROADCAST_QUEUE
  760. ~~~~~~~~~~~~~~~~~~~~~~
  761. Name prefix for the queue used when listening for broadcast messages.
  762. The workers host name will be appended to the prefix to create the final
  763. queue name.
  764. Default is `"celeryctl"`.
  765. .. setting:: CELERY_BROADCAST_EXCHANGE
  766. CELERY_BROADCAST_EXCHANGE
  767. ~~~~~~~~~~~~~~~~~~~~~~~~~
  768. Name of the exchange used for broadcast messages.
  769. Default is `"celeryctl"`.
  770. .. setting:: CELERY_BROADCAST_EXCHANGE_TYPE
  771. CELERY_BROADCAST_EXCHANGE_TYPE
  772. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  773. Exchange type used for broadcast messages. Default is `"fanout"`.
  774. .. _conf-logging:
  775. Logging
  776. -------
  777. .. setting:: CELERYD_HIJACK_ROOT_LOGGER
  778. CELERYD_HIJACK_ROOT_LOGGER
  779. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  780. .. versionadded:: 2.2
  781. By default any previously configured logging options will be reset,
  782. because the Celery programs "hijacks" the root logger.
  783. If you want to customize your own logging then you can disable
  784. this behavior.
  785. .. note::
  786. Logging can also be customized by connecting to the
  787. :signal:`celery.signals.setup_logging` signal.
  788. .. setting:: CELERYD_LOG_COLOR
  789. CELERYD_LOG_COLOR
  790. ~~~~~~~~~~~~~~~~~
  791. Enables/disables colors in logging output by the Celery apps.
  792. By default colors are enabled if
  793. 1) the app is logging to a real terminal, and not a file.
  794. 2) the app is not running on Windows.
  795. .. setting:: CELERYD_LOG_FORMAT
  796. CELERYD_LOG_FORMAT
  797. ~~~~~~~~~~~~~~~~~~
  798. The format to use for log messages.
  799. Default is `[%(asctime)s: %(levelname)s/%(processName)s] %(message)s`
  800. See the Python :mod:`logging` module for more information about log
  801. formats.
  802. .. setting:: CELERYD_TASK_LOG_FORMAT
  803. CELERYD_TASK_LOG_FORMAT
  804. ~~~~~~~~~~~~~~~~~~~~~~~
  805. The format to use for log messages logged in tasks. Can be overridden using
  806. the :option:`--loglevel` option to :mod:`~celery.bin.celeryd`.
  807. Default is::
  808. [%(asctime)s: %(levelname)s/%(processName)s]
  809. [%(task_name)s(%(task_id)s)] %(message)s
  810. See the Python :mod:`logging` module for more information about log
  811. formats.
  812. .. setting:: CELERY_REDIRECT_STDOUTS
  813. CELERY_REDIRECT_STDOUTS
  814. ~~~~~~~~~~~~~~~~~~~~~~~
  815. If enabled `stdout` and `stderr` will be redirected
  816. to the current logger.
  817. Enabled by default.
  818. Used by :program:`celeryd` and :program:`celerybeat`.
  819. .. setting:: CELERY_REDIRECT_STDOUTS_LEVEL
  820. CELERY_REDIRECT_STDOUTS_LEVEL
  821. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  822. The log level output to `stdout` and `stderr` is logged as.
  823. Can be one of :const:`DEBUG`, :const:`INFO`, :const:`WARNING`,
  824. :const:`ERROR` or :const:`CRITICAL`.
  825. Default is :const:`WARNING`.
  826. .. _conf-security:
  827. Security
  828. --------
  829. .. setting:: CELERY_SECURITY_KEY
  830. CELERY_SECURITY_KEY
  831. ~~~~~~~~~~~~~~~~~~~
  832. .. versionadded:: 2.5
  833. The relative or absolute path to a file containing the private key
  834. used to sign messages when :ref:`message-signing` is used.
  835. .. setting:: CELERY_SECURITY_CERTIFICATE
  836. CELERY_SECURITY_CERTIFICATE
  837. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  838. .. versionadded:: 2.5
  839. The relative or absolute path to an X.509 certificate file
  840. used to sign messages when :ref:`message-signing` is used.
  841. .. setting:: CELERY_SECURITY_CERT_STORE
  842. CELERY_SECURITY_CERT_STORE
  843. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  844. .. versionadded:: 2.5
  845. The directory containing X.509 certificates used for
  846. :ref:`message-signing`. Can be a glob with wildcards,
  847. (for example :file:`/etc/certs/*.pem`).
  848. .. _conf-custom-components:
  849. Custom Component Classes (advanced)
  850. -----------------------------------
  851. .. setting:: CELERYD_BOOT_STEPS
  852. CELERYD_BOOT_STEPS
  853. ~~~~~~~~~~~~~~~~~~
  854. This setting enables you to add additional components to the worker process.
  855. It should be a list of module names with :class:`celery.abstract.Component`
  856. classes, that augments functionality in the worker.
  857. .. setting:: CELERYD_POOL
  858. CELERYD_POOL
  859. ~~~~~~~~~~~~
  860. Name of the pool class used by the worker.
  861. You can use a custom pool class name, or select one of
  862. the built-in aliases: ``processes``, ``eventlet``, ``gevent``.
  863. Default is ``processes``.
  864. .. setting:: CELERYD_AUTOSCALER
  865. CELERYD_AUTOSCALER
  866. ~~~~~~~~~~~~~~~~~~
  867. .. versionadded:: 2.2
  868. Name of the autoscaler class to use.
  869. Default is ``"celery.worker.autoscale.Autoscaler"``.
  870. .. setting:: CELERYD_AUTORELOADER
  871. CELERYD_AUTORELOADER
  872. ~~~~~~~~~~~~~~~~~~~~
  873. Name of the autoreloader class used by the worker to reload
  874. Python modules and files that have changed.
  875. Default is: ``"celery.worker.autoreload.Autoreloader"``.
  876. .. setting:: CELERYD_CONSUMER
  877. CELERYD_CONSUMER
  878. ~~~~~~~~~~~~~~~~
  879. Name of the consumer class used by the worker.
  880. Default is :class:`celery.worker.consumer.Consumer`
  881. .. setting:: CELERYD_MEDIATOR
  882. CELERYD_MEDIATOR
  883. ~~~~~~~~~~~~~~~~
  884. Name of the mediator class used by the worker.
  885. Default is :class:`celery.worker.controllers.Mediator`.
  886. .. setting:: CELERYD_TIMER
  887. CELERYD_TIMER
  888. ~~~~~~~~~~~~~~~~~~~~~
  889. Name of the ETA scheduler class used by the worker.
  890. Default is :class:`celery.utils.timer2.Timer`, or one overrided
  891. by the pool implementation.
  892. .. _conf-celerybeat:
  893. Periodic Task Server: celerybeat
  894. --------------------------------
  895. .. setting:: CELERYBEAT_SCHEDULE
  896. CELERYBEAT_SCHEDULE
  897. ~~~~~~~~~~~~~~~~~~~
  898. The periodic task schedule used by :mod:`~celery.bin.celerybeat`.
  899. See :ref:`beat-entries`.
  900. .. setting:: CELERYBEAT_SCHEDULER
  901. CELERYBEAT_SCHEDULER
  902. ~~~~~~~~~~~~~~~~~~~~
  903. The default scheduler class. Default is
  904. `"celery.beat.PersistentScheduler"`.
  905. Can also be set via the :option:`-S` argument to
  906. :mod:`~celery.bin.celerybeat`.
  907. .. setting:: CELERYBEAT_SCHEDULE_FILENAME
  908. CELERYBEAT_SCHEDULE_FILENAME
  909. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  910. Name of the file used by `PersistentScheduler` to store the last run times
  911. of periodic tasks. Can be a relative or absolute path, but be aware that the
  912. suffix `.db` may be appended to the file name (depending on Python version).
  913. Can also be set via the :option:`--schedule` argument to
  914. :mod:`~celery.bin.celerybeat`.
  915. .. setting:: CELERYBEAT_MAX_LOOP_INTERVAL
  916. CELERYBEAT_MAX_LOOP_INTERVAL
  917. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  918. The maximum number of seconds :mod:`~celery.bin.celerybeat` can sleep
  919. between checking the schedule.
  920. The default for this value is scheduler specific.
  921. For the default celerybeat scheduler the value is 300 (5 minutes),
  922. but for e.g. the django-celery database scheduler it is 5 seconds
  923. because the schedule may be changed externally, and so it must take
  924. changes to the schedule into account.
  925. Also when running celerybeat embedded (:option:`-B`) on Jython as a thread
  926. the max interval is overridden and set to 1 so that it's possible
  927. to shut down in a timely manner.
  928. .. _conf-celerymon:
  929. Monitor Server: celerymon
  930. -------------------------
  931. .. setting:: CELERYMON_LOG_FORMAT
  932. CELERYMON_LOG_FORMAT
  933. ~~~~~~~~~~~~~~~~~~~~
  934. The format to use for log messages.
  935. Default is `[%(asctime)s: %(levelname)s/%(processName)s] %(message)s`
  936. See the Python :mod:`logging` module for more information about log
  937. formats.