configuration.rst 39 KB

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