forked from celery/celery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration.html
1364 lines (1336 loc) · 98.5 KB
/
configuration.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Configuration and defaults — Celery 2.6.0a3 documentation</title>
<link rel="stylesheet" href="_static/celery.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/issuetracker.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '2.6.0a3',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Celery 2.6.0a3 documentation" href="index.html" />
<link rel="next" title="Django" href="django/index.html" />
<link rel="prev" title="Signals" href="userguide/signals.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="django/index.html" title="Django"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="userguide/signals.html" title="Signals"
accesskey="P">previous</a> |</li>
<li><a href="index.html">Celery 2.6.0a3 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="deck">
<p class="developmentversion">
This document is for Celery's development version, which can be
significantly different from previous releases. Get old docs here:
<a href="http://docs.celeryproject.org/en/latest/configuration.html">2.5</a>.
</p>
</div>
<div class="section" id="configuration-and-defaults">
<span id="configuration"></span><h1>Configuration and defaults<a class="headerlink" href="#configuration-and-defaults" title="Permalink to this headline">¶</a></h1>
<p>This document describes the configuration options available.</p>
<p>If you’re using the default loader, you must create the <tt class="file docutils literal"><span class="pre">celeryconfig.py</span></tt>
module and make sure it is available on the Python path.</p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#example-configuration-file" id="id5">Example configuration file</a></li>
<li><a class="reference internal" href="#configuration-directives" id="id6">Configuration Directives</a><ul>
<li><a class="reference internal" href="#time-and-date-settings" id="id7">Time and date settings</a></li>
<li><a class="reference internal" href="#celery-timezone" id="id8">CELERY_TIMEZONE</a></li>
<li><a class="reference internal" href="#task-settings" id="id9">Task settings</a></li>
<li><a class="reference internal" href="#concurrency-settings" id="id10">Concurrency settings</a></li>
<li><a class="reference internal" href="#task-result-backend-settings" id="id11">Task result backend settings</a></li>
<li><a class="reference internal" href="#database-backend-settings" id="id12">Database backend settings</a></li>
<li><a class="reference internal" href="#amqp-backend-settings" id="id13">AMQP backend settings</a></li>
<li><a class="reference internal" href="#cache-backend-settings" id="id14">Cache backend settings</a></li>
<li><a class="reference internal" href="#redis-backend-settings" id="id15">Redis backend settings</a></li>
<li><a class="reference internal" href="#mongodb-backend-settings" id="id16">MongoDB backend settings</a></li>
<li><a class="reference internal" href="#cassandra-backend-settings" id="id17">Cassandra backend settings</a></li>
<li><a class="reference internal" href="#message-routing" id="id18">Message Routing</a></li>
<li><a class="reference internal" href="#broker-settings" id="id19">Broker Settings</a></li>
<li><a class="reference internal" href="#task-execution-settings" id="id20">Task execution settings</a></li>
<li><a class="reference internal" href="#worker-celeryd" id="id21">Worker: celeryd</a></li>
<li><a class="reference internal" href="#error-e-mails" id="id22">Error E-Mails</a></li>
<li><a class="reference internal" href="#events" id="id23">Events</a></li>
<li><a class="reference internal" href="#broadcast-commands" id="id24">Broadcast Commands</a></li>
<li><a class="reference internal" href="#logging" id="id25">Logging</a></li>
<li><a class="reference internal" href="#security" id="id26">Security</a></li>
<li><a class="reference internal" href="#custom-component-classes-advanced" id="id27">Custom Component Classes (advanced)</a></li>
<li><a class="reference internal" href="#periodic-task-server-celerybeat" id="id28">Periodic Task Server: celerybeat</a></li>
<li><a class="reference internal" href="#monitor-server-celerymon" id="id29">Monitor Server: celerymon</a></li>
<li><a class="reference internal" href="#deprecated-settings" id="id30">Deprecated Settings</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="example-configuration-file">
<span id="conf-example"></span><h2><a class="toc-backref" href="#id5">Example configuration file</a><a class="headerlink" href="#example-configuration-file" title="Permalink to this headline">¶</a></h2>
<p>This is an example configuration file to get you started.
It should contain all you need to run a basic Celery set-up.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c"># List of modules to import when celery starts.</span>
<span class="n">CELERY_IMPORTS</span> <span class="o">=</span> <span class="p">(</span><span class="s">"myapp.tasks"</span><span class="p">,</span> <span class="p">)</span>
<span class="c">## Result store settings.</span>
<span class="n">CELERY_RESULT_BACKEND</span> <span class="o">=</span> <span class="s">"database"</span>
<span class="n">CELERY_RESULT_DBURI</span> <span class="o">=</span> <span class="s">"sqlite:///mydatabase.db"</span>
<span class="c">## Broker settings.</span>
<span class="n">BROKER_URL</span> <span class="o">=</span> <span class="s">"amqp://guest:guest@localhost:5672//"</span>
<span class="c">## Worker settings</span>
<span class="c">## If you're doing mostly I/O you can have more processes,</span>
<span class="c">## but if mostly spending CPU, try to keep it close to the</span>
<span class="c">## number of CPUs on your machine. If not set, the number of CPUs/cores</span>
<span class="c">## available will be used.</span>
<span class="n">CELERYD_CONCURRENCY</span> <span class="o">=</span> <span class="mi">10</span>
<span class="n">CELERY_ANNOTATIONS</span> <span class="o">=</span> <span class="p">{</span><span class="s">"tasks.add"</span><span class="p">:</span> <span class="p">{</span><span class="s">"rate_limit"</span><span class="p">:</span> <span class="s">"10/s"</span><span class="p">}}</span>
</pre></div>
</div>
</div>
<div class="section" id="configuration-directives">
<h2><a class="toc-backref" href="#id6">Configuration Directives</a><a class="headerlink" href="#configuration-directives" title="Permalink to this headline">¶</a></h2>
<div class="section" id="time-and-date-settings">
<span id="conf-datetime"></span><h3><a class="toc-backref" href="#id7">Time and date settings</a><a class="headerlink" href="#time-and-date-settings" title="Permalink to this headline">¶</a></h3>
<div class="section" id="celery-enable-utc">
<span id="std:setting-CELERY_ENABLE_UTC"></span><h4>CELERY_ENABLE_UTC<a class="headerlink" href="#celery-enable-utc" title="Permalink to this headline">¶</a></h4>
<p>If enabled dates and times in messages will be converted to use
the UTC timezone.</p>
<p>Note that workers running Celery versions below 2.5 will assume a local
timezone for all messages, so only enable if all workers have been
upgraded.</p>
<p>Disabled by default. UTC will be enabled by default in version 3.0.</p>
</div>
</div>
<div class="section" id="celery-timezone">
<span id="std:setting-CELERY_TIMEZONE"></span><h3><a class="toc-backref" href="#id8">CELERY_TIMEZONE</a><a class="headerlink" href="#celery-timezone" title="Permalink to this headline">¶</a></h3>
<p>Configure Celery to use a custom time zone.
The timezone value can be any time zone supported by the <tt class="xref py py-mod docutils literal"><span class="pre">pytz</span></tt>
library. <tt class="xref py py-mod docutils literal"><span class="pre">pytz</span></tt> must be installed for the selected zone
to be used.</p>
<p>If not set then the systems default local time zone is used.</p>
</div>
<div class="section" id="task-settings">
<span id="conf-tasks"></span><h3><a class="toc-backref" href="#id9">Task settings</a><a class="headerlink" href="#task-settings" title="Permalink to this headline">¶</a></h3>
<div class="section" id="celery-annotations">
<span id="std:setting-CELERY_ANNOTATIONS"></span><h4>CELERY_ANNOTATIONS<a class="headerlink" href="#celery-annotations" title="Permalink to this headline">¶</a></h4>
<p>This setting can be used to rewrite any task attribute from the
configuration. The setting can be a dict, or a list of annotation
objects that filter for tasks and return a map of attributes
to change.</p>
<p>This will change the <tt class="docutils literal"><span class="pre">rate_limit</span></tt> attribute for the <tt class="docutils literal"><span class="pre">tasks.add</span></tt>
task:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">CELERY_ANNOTATIONS</span> <span class="o">=</span> <span class="p">{</span><span class="s">"tasks.add"</span><span class="p">:</span> <span class="p">{</span><span class="s">"rate_limit"</span><span class="p">:</span> <span class="s">"10/s"</span><span class="p">}}</span>
</pre></div>
</div>
<p>or change the same for all tasks:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">CELERY_ANNOTATIONS</span> <span class="o">=</span> <span class="p">{</span><span class="s">"*"</span><span class="p">:</span> <span class="p">{</span><span class="s">"rate_limit"</span><span class="p">:</span> <span class="s">"10/s"</span><span class="p">}}</span>
</pre></div>
</div>
<p>You can change methods too, for example the <tt class="docutils literal"><span class="pre">on_failure</span></tt> handler:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">def</span> <span class="nf">my_on_failure</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">exc</span><span class="p">,</span> <span class="n">task_id</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">kwargs</span><span class="p">,</span> <span class="n">einfo</span><span class="p">):</span>
<span class="k">print</span><span class="p">(</span><span class="s">"Oh no! Task failed: </span><span class="si">%r</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">exc</span><span class="p">,</span> <span class="p">))</span>
<span class="n">CELERY_ANNOTATIONS</span> <span class="o">=</span> <span class="p">{</span><span class="s">"*"</span><span class="p">:</span> <span class="p">{</span><span class="s">"on_failure"</span><span class="p">:</span> <span class="n">my_on_failure</span><span class="p">}}</span>
</pre></div>
</div>
<p>If you need more flexibility then you can use objects
instead of a dict to choose which tasks to annotate:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">class</span> <span class="nc">MyAnnotate</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">annotate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">task</span><span class="p">):</span>
<span class="k">if</span> <span class="n">task</span><span class="o">.</span><span class="n">name</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s">"tasks."</span><span class="p">):</span>
<span class="k">return</span> <span class="p">{</span><span class="s">"rate_limit"</span><span class="p">:</span> <span class="s">"10/s"</span><span class="p">}</span>
<span class="n">CELERY_ANNOTATIONS</span> <span class="o">=</span> <span class="p">(</span><span class="n">MyAnnotate</span><span class="p">(),</span> <span class="p">{</span><span class="o">...</span><span class="p">})</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="concurrency-settings">
<span id="conf-concurrency"></span><h3><a class="toc-backref" href="#id10">Concurrency settings</a><a class="headerlink" href="#concurrency-settings" title="Permalink to this headline">¶</a></h3>
<div class="section" id="celeryd-concurrency">
<span id="std:setting-CELERYD_CONCURRENCY"></span><h4>CELERYD_CONCURRENCY<a class="headerlink" href="#celeryd-concurrency" title="Permalink to this headline">¶</a></h4>
<p>The number of concurrent worker processes/threads/green threads, executing
tasks.</p>
<p>Defaults to the number of available CPUs.</p>
</div>
<div class="section" id="celeryd-prefetch-multiplier">
<span id="std:setting-CELERYD_PREFETCH_MULTIPLIER"></span><h4>CELERYD_PREFETCH_MULTIPLIER<a class="headerlink" href="#celeryd-prefetch-multiplier" title="Permalink to this headline">¶</a></h4>
<p>How many messages to prefetch at a time multiplied by the number of
concurrent processes. The default is 4 (four messages for each
process). The default setting is usually a good choice, however – if you
have very long running tasks waiting in the queue and you have to start the
workers, note that the first worker to start will receive four times the
number of messages initially. Thus the tasks may not be fairly distributed
to the workers.</p>
</div>
</div>
<div class="section" id="task-result-backend-settings">
<span id="conf-result-backend"></span><h3><a class="toc-backref" href="#id11">Task result backend settings</a><a class="headerlink" href="#task-result-backend-settings" title="Permalink to this headline">¶</a></h3>
<div class="section" id="celery-result-backend">
<span id="std:setting-CELERY_RESULT_BACKEND"></span><h4>CELERY_RESULT_BACKEND<a class="headerlink" href="#celery-result-backend" title="Permalink to this headline">¶</a></h4>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name" colspan="2">Deprecated aliases:</th></tr>
<tr class="field-odd field"><td> </td><td class="field-body"><tt class="docutils literal"><span class="pre">CELERY_BACKEND</span></tt></td>
</tr>
</tbody>
</table>
<p>The backend used to store task results (tombstones).
Disabled by default.
Can be one of the following:</p>
<ul>
<li><dl class="first docutils">
<dt>database</dt>
<dd><p class="first last">Use a relational database supported by <a class="reference external" href="http://sqlalchemy.org">SQLAlchemy</a>.
See <a class="reference internal" href="#conf-database-result-backend"><em>Database backend settings</em></a>.</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>cache</dt>
<dd><p class="first last">Use <a class="reference external" href="http://memcached.org">memcached</a> to store the results.
See <a class="reference internal" href="#conf-cache-result-backend"><em>Cache backend settings</em></a>.</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>mongodb</dt>
<dd><p class="first last">Use <a class="reference external" href="http://mongodb.org">MongoDB</a> to store the results.
See <a class="reference internal" href="#conf-mongodb-result-backend"><em>MongoDB backend settings</em></a>.</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>redis</dt>
<dd><p class="first last">Use <a class="reference external" href="http://code.google.com/p/redis/">Redis</a> to store the results.
See <a class="reference internal" href="#conf-redis-result-backend"><em>Redis backend settings</em></a>.</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>amqp</dt>
<dd><p class="first last">Send results back as AMQP messages
See <a class="reference internal" href="#conf-amqp-result-backend"><em>AMQP backend settings</em></a>.</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>cassandra</dt>
<dd><p class="first last">Use <a class="reference external" href="http://cassandra.apache.org/">Cassandra</a> to store the results.
See <a class="reference internal" href="#conf-cassandra-result-backend"><em>Cassandra backend settings</em></a>.</p>
</dd>
</dl>
</li>
</ul>
</div>
<div class="section" id="celery-result-serializer">
<span id="std:setting-CELERY_RESULT_SERIALIZER"></span><h4>CELERY_RESULT_SERIALIZER<a class="headerlink" href="#celery-result-serializer" title="Permalink to this headline">¶</a></h4>
<p>Result serialization format. Default is <cite>“pickle”</cite>. See
<a class="reference internal" href="userguide/executing.html#executing-serializers"><em>Serializers</em></a> for information about supported
serialization formats.</p>
</div>
</div>
<div class="section" id="database-backend-settings">
<span id="conf-database-result-backend"></span><h3><a class="toc-backref" href="#id12">Database backend settings</a><a class="headerlink" href="#database-backend-settings" title="Permalink to this headline">¶</a></h3>
<div class="section" id="celery-result-dburi">
<span id="std:setting-CELERY_RESULT_DBURI"></span><h4>CELERY_RESULT_DBURI<a class="headerlink" href="#celery-result-dburi" title="Permalink to this headline">¶</a></h4>
<p>Please see <a class="reference external" href="http://www.sqlalchemy.org/docs/core/engines.html#supported-databases">Supported Databases</a> for a table of supported databases.
To use this backend you need to configure it with an
<a class="reference external" href="http://www.sqlalchemy.org/docs/core/engines.html#database-urls">Connection String</a>, some examples include:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c"># sqlite (filename)</span>
<span class="n">CELERY_RESULT_DBURI</span> <span class="o">=</span> <span class="s">"sqlite:///celerydb.sqlite"</span>
<span class="c"># mysql</span>
<span class="n">CELERY_RESULT_DBURI</span> <span class="o">=</span> <span class="s">"mysql://scott:tiger@localhost/foo"</span>
<span class="c"># postgresql</span>
<span class="n">CELERY_RESULT_DBURI</span> <span class="o">=</span> <span class="s">"postgresql://scott:tiger@localhost/mydatabase"</span>
<span class="c"># oracle</span>
<span class="n">CELERY_RESULT_DBURI</span> <span class="o">=</span> <span class="s">"oracle://scott:[email protected]:1521/sidname"</span>
</pre></div>
</div>
<p>See <a class="reference external" href="http://www.sqlalchemy.org/docs/core/engines.html#database-urls">Connection String</a> for more information about connection
strings.</p>
</div>
<div class="section" id="celery-result-engine-options">
<span id="std:setting-CELERY_RESULT_ENGINE_OPTIONS"></span><h4>CELERY_RESULT_ENGINE_OPTIONS<a class="headerlink" href="#celery-result-engine-options" title="Permalink to this headline">¶</a></h4>
<p>To specify additional SQLAlchemy database engine options you can use
the <a class="reference internal" href="#std:setting-CELERY_RESULT_ENGINE_OPTIONS"><tt class="xref std std-setting docutils literal"><span class="pre">CELERY_RESULT_ENGINE_OPTIONS</span></tt></a> setting:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c"># echo enables verbose logging from SQLAlchemy.</span>
<span class="n">CELERY_RESULT_ENGINE_OPTIONS</span> <span class="o">=</span> <span class="p">{</span><span class="s">"echo"</span><span class="p">:</span> <span class="bp">True</span><span class="p">}</span>
</pre></div>
</div>
<p id="std:setting-CELERY_RESULT_DB_SHORT_LIVED_SESSIONS CELERY_RESULT_DB_SHORT_LIVED_SESSIONS = True">Short lived sessions are disabled by default. If enabled they can drastically reduce
performance, especially on systems processing lots of tasks. This option is useful
on low-traffic workers that experience errors as a result of cached database connections
going stale through inactivity. For example, intermittent errors like
<cite>(OperationalError) (2006, ‘MySQL server has gone away’)</cite> can be fixed by enabling
short lived sessions. This option only affects the database backend.</p>
</div>
<div class="section" id="example-configuration">
<h4>Example configuration<a class="headerlink" href="#example-configuration" title="Permalink to this headline">¶</a></h4>
<div class="highlight-python"><div class="highlight"><pre><span class="n">CELERY_RESULT_BACKEND</span> <span class="o">=</span> <span class="s">"database"</span>
<span class="n">CELERY_RESULT_DBURI</span> <span class="o">=</span> <span class="s">"mysql://user:password@host/dbname"</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="amqp-backend-settings">
<span id="conf-amqp-result-backend"></span><h3><a class="toc-backref" href="#id13">AMQP backend settings</a><a class="headerlink" href="#amqp-backend-settings" title="Permalink to this headline">¶</a></h3>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>The AMQP backend requires RabbitMQ 1.1.0 or higher to automatically
expire results. If you are running an older version of RabbitmQ
you should disable result expiration like this:</p>
<blockquote class="last">
<div>CELERY_TASK_RESULT_EXPIRES = None</div></blockquote>
</div>
<div class="section" id="celery-result-exchange">
<span id="std:setting-CELERY_RESULT_EXCHANGE"></span><h4>CELERY_RESULT_EXCHANGE<a class="headerlink" href="#celery-result-exchange" title="Permalink to this headline">¶</a></h4>
<p>Name of the exchange to publish results in. Default is <cite>“celeryresults”</cite>.</p>
</div>
<div class="section" id="celery-result-exchange-type">
<span id="std:setting-CELERY_RESULT_EXCHANGE_TYPE"></span><h4>CELERY_RESULT_EXCHANGE_TYPE<a class="headerlink" href="#celery-result-exchange-type" title="Permalink to this headline">¶</a></h4>
<p>The exchange type of the result exchange. Default is to use a <cite>direct</cite>
exchange.</p>
</div>
<div class="section" id="celery-result-persistent">
<span id="std:setting-CELERY_RESULT_PERSISTENT"></span><h4>CELERY_RESULT_PERSISTENT<a class="headerlink" href="#celery-result-persistent" title="Permalink to this headline">¶</a></h4>
<p>If set to <tt class="xref py py-const docutils literal"><span class="pre">True</span></tt>, result messages will be persistent. This means the
messages will not be lost after a broker restart. The default is for the
results to be transient.</p>
</div>
<div class="section" id="id1">
<h4>Example configuration<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h4>
<div class="highlight-python"><div class="highlight"><pre><span class="n">CELERY_RESULT_BACKEND</span> <span class="o">=</span> <span class="s">"amqp"</span>
<span class="n">CELERY_TASK_RESULT_EXPIRES</span> <span class="o">=</span> <span class="mi">18000</span> <span class="c"># 5 hours.</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="cache-backend-settings">
<span id="conf-cache-result-backend"></span><h3><a class="toc-backref" href="#id14">Cache backend settings</a><a class="headerlink" href="#cache-backend-settings" title="Permalink to this headline">¶</a></h3>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The cache backend supports the <a class="reference external" href="http://sendapatch.se/projects/pylibmc/">pylibmc</a> and <cite>python-memcached</cite>
libraries. The latter is used only if <a class="reference external" href="http://sendapatch.se/projects/pylibmc/">pylibmc</a> is not installed.</p>
</div>
<div class="section" id="celery-cache-backend">
<span id="std:setting-CELERY_CACHE_BACKEND"></span><h4>CELERY_CACHE_BACKEND<a class="headerlink" href="#celery-cache-backend" title="Permalink to this headline">¶</a></h4>
<p>Using a single memcached server:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">CELERY_CACHE_BACKEND</span> <span class="o">=</span> <span class="s">'memcached://127.0.0.1:11211/'</span>
</pre></div>
</div>
<p>Using multiple memcached servers:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">CELERY_RESULT_BACKEND</span> <span class="o">=</span> <span class="s">"cache"</span>
<span class="n">CELERY_CACHE_BACKEND</span> <span class="o">=</span> <span class="s">'memcached://172.19.26.240:11211;172.19.26.242:11211/'</span>
</pre></div>
</div>
<p id="std:setting-CELERY_CACHE_BACKEND_OPTIONS">The “dummy” backend stores the cache in memory only:</p>
<blockquote>
<div>CELERY_CACHE_BACKEND = “dummy”</div></blockquote>
</div>
<div class="section" id="celery-cache-backend-options">
<h4>CELERY_CACHE_BACKEND_OPTIONS<a class="headerlink" href="#celery-cache-backend-options" title="Permalink to this headline">¶</a></h4>
<p>You can set pylibmc options using the <a class="reference internal" href="#std:setting-CELERY_CACHE_BACKEND_OPTIONS"><tt class="xref std std-setting docutils literal"><span class="pre">CELERY_CACHE_BACKEND_OPTIONS</span></tt></a>
setting:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">CELERY_CACHE_BACKEND_OPTIONS</span> <span class="o">=</span> <span class="p">{</span><span class="s">"binary"</span><span class="p">:</span> <span class="bp">True</span><span class="p">,</span>
<span class="s">"behaviors"</span><span class="p">:</span> <span class="p">{</span><span class="s">"tcp_nodelay"</span><span class="p">:</span> <span class="bp">True</span><span class="p">}}</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="redis-backend-settings">
<span id="conf-redis-result-backend"></span><h3><a class="toc-backref" href="#id15">Redis backend settings</a><a class="headerlink" href="#redis-backend-settings" title="Permalink to this headline">¶</a></h3>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>The Redis backend requires the <tt class="xref py py-mod docutils literal"><span class="pre">redis</span></tt> library:
<a class="reference external" href="http://pypi.python.org/pypi/redis/">http://pypi.python.org/pypi/redis/</a></p>
<p>To install the redis package use <cite>pip</cite> or <cite>easy_install</cite>:</p>
<div class="last highlight-python"><pre>$ pip install redis</pre>
</div>
</div>
<p>This backend requires the following configuration directives to be set.</p>
<div class="section" id="celery-redis-host">
<span id="std:setting-CELERY_REDIS_HOST"></span><h4>CELERY_REDIS_HOST<a class="headerlink" href="#celery-redis-host" title="Permalink to this headline">¶</a></h4>
<p>Host name of the Redis database server. e.g. <cite>“localhost”</cite>.</p>
</div>
<div class="section" id="celery-redis-port">
<span id="std:setting-CELERY_REDIS_PORT"></span><h4>CELERY_REDIS_PORT<a class="headerlink" href="#celery-redis-port" title="Permalink to this headline">¶</a></h4>
<p>Port to the Redis database server. e.g. <cite>6379</cite>.</p>
</div>
<div class="section" id="celery-redis-db">
<span id="std:setting-CELERY_REDIS_DB"></span><h4>CELERY_REDIS_DB<a class="headerlink" href="#celery-redis-db" title="Permalink to this headline">¶</a></h4>
<p>Database number to use. Default is 0</p>
</div>
<div class="section" id="celery-redis-password">
<span id="std:setting-CELERY_REDIS_PASSWORD"></span><h4>CELERY_REDIS_PASSWORD<a class="headerlink" href="#celery-redis-password" title="Permalink to this headline">¶</a></h4>
<p>Password used to connect to the database.</p>
</div>
<div class="section" id="celery-redis-max-connections">
<span id="std:setting-CELERY_REDIS_MAX_CONNECTIONS"></span><h4>CELERY_REDIS_MAX_CONNECTIONS<a class="headerlink" href="#celery-redis-max-connections" title="Permalink to this headline">¶</a></h4>
<p>Maximum number of connections available in the Redis connection
pool used for sending and retrieving results.</p>
</div>
<div class="section" id="id2">
<h4>Example configuration<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h4>
<div class="highlight-python"><div class="highlight"><pre><span class="n">CELERY_RESULT_BACKEND</span> <span class="o">=</span> <span class="s">"redis"</span>
<span class="n">CELERY_REDIS_HOST</span> <span class="o">=</span> <span class="s">"localhost"</span>
<span class="n">CELERY_REDIS_PORT</span> <span class="o">=</span> <span class="mi">6379</span>
<span class="n">CELERY_REDIS_DB</span> <span class="o">=</span> <span class="mi">0</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="mongodb-backend-settings">
<span id="conf-mongodb-result-backend"></span><h3><a class="toc-backref" href="#id16">MongoDB backend settings</a><a class="headerlink" href="#mongodb-backend-settings" title="Permalink to this headline">¶</a></h3>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The MongoDB backend requires the <tt class="xref py py-mod docutils literal"><span class="pre">pymongo</span></tt> library:
<a class="reference external" href="http://github.com/mongodb/mongo-python-driver/tree/master">http://github.com/mongodb/mongo-python-driver/tree/master</a></p>
</div>
<div class="section" id="celery-mongodb-backend-settings">
<span id="std:setting-CELERY_MONGODB_BACKEND_SETTINGS"></span><h4>CELERY_MONGODB_BACKEND_SETTINGS<a class="headerlink" href="#celery-mongodb-backend-settings" title="Permalink to this headline">¶</a></h4>
<p>This is a dict supporting the following keys:</p>
<ul>
<li><dl class="first docutils">
<dt>host</dt>
<dd><p class="first last">Host name of the MongoDB server. Defaults to “localhost”.</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>port</dt>
<dd><p class="first last">The port the MongoDB server is listening to. Defaults to 27017.</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>user</dt>
<dd><p class="first last">User name to authenticate to the MongoDB server as (optional).</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>password</dt>
<dd><p class="first last">Password to authenticate to the MongoDB server (optional).</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>database</dt>
<dd><p class="first last">The database name to connect to. Defaults to “celery”.</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>taskmeta_collection</dt>
<dd><p class="first last">The collection name to store task meta data.
Defaults to “celery_taskmeta”.</p>
</dd>
</dl>
</li>
</ul>
</div>
<div class="section" id="example-mongodb-result-config">
<span id="id3"></span><h4>Example configuration<a class="headerlink" href="#example-mongodb-result-config" title="Permalink to this headline">¶</a></h4>
<div class="highlight-python"><div class="highlight"><pre><span class="n">CELERY_RESULT_BACKEND</span> <span class="o">=</span> <span class="s">"mongodb"</span>
<span class="n">CELERY_MONGODB_BACKEND_SETTINGS</span> <span class="o">=</span> <span class="p">{</span>
<span class="s">"host"</span><span class="p">:</span> <span class="s">"192.168.1.100"</span><span class="p">,</span>
<span class="s">"port"</span><span class="p">:</span> <span class="mi">30000</span><span class="p">,</span>
<span class="s">"database"</span><span class="p">:</span> <span class="s">"mydb"</span><span class="p">,</span>
<span class="s">"taskmeta_collection"</span><span class="p">:</span> <span class="s">"my_taskmeta_collection"</span><span class="p">,</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="cassandra-backend-settings">
<span id="conf-cassandra-result-backend"></span><h3><a class="toc-backref" href="#id17">Cassandra backend settings</a><a class="headerlink" href="#cassandra-backend-settings" title="Permalink to this headline">¶</a></h3>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>The Cassandra backend requires the <tt class="xref py py-mod docutils literal"><span class="pre">pycassa</span></tt> library:
<a class="reference external" href="http://pypi.python.org/pypi/pycassa/">http://pypi.python.org/pypi/pycassa/</a></p>
<p>To install the pycassa package use <cite>pip</cite> or <cite>easy_install</cite>:</p>
<div class="last highlight-python"><pre>$ pip install pycassa</pre>
</div>
</div>
<p>This backend requires the following configuration directives to be set.</p>
<div class="section" id="cassandra-servers">
<span id="std:setting-CASSANDRA_SERVERS"></span><h4>CASSANDRA_SERVERS<a class="headerlink" href="#cassandra-servers" title="Permalink to this headline">¶</a></h4>
<p>List of <tt class="docutils literal"><span class="pre">host:port</span></tt> Cassandra servers. e.g. <tt class="docutils literal"><span class="pre">["localhost:9160]"</span></tt>.</p>
</div>
<div class="section" id="cassandra-keyspace">
<span id="std:setting-CASSANDRA_KEYSPACE"></span><h4>CASSANDRA_KEYSPACE<a class="headerlink" href="#cassandra-keyspace" title="Permalink to this headline">¶</a></h4>
<p>The keyspace in which to store the results. e.g. <tt class="docutils literal"><span class="pre">"tasks_keyspace"</span></tt>.</p>
</div>
<div class="section" id="cassandra-column-family">
<span id="std:setting-CASSANDRA_COLUMN_FAMILY"></span><h4>CASSANDRA_COLUMN_FAMILY<a class="headerlink" href="#cassandra-column-family" title="Permalink to this headline">¶</a></h4>
<p>The column family in which to store the results. eg <tt class="docutils literal"><span class="pre">"tasks"</span></tt></p>
</div>
<div class="section" id="cassandra-read-consistency">
<span id="std:setting-CASSANDRA_READ_CONSISTENCY"></span><h4>CASSANDRA_READ_CONSISTENCY<a class="headerlink" href="#cassandra-read-consistency" title="Permalink to this headline">¶</a></h4>
<p>The read consistency used. Values can be <tt class="docutils literal"><span class="pre">"ONE"</span></tt>, <tt class="docutils literal"><span class="pre">"QUORUM"</span></tt> or <tt class="docutils literal"><span class="pre">"ALL"</span></tt>.</p>
</div>
<div class="section" id="cassandra-write-consistency">
<span id="std:setting-CASSANDRA_WRITE_CONSISTENCY"></span><h4>CASSANDRA_WRITE_CONSISTENCY<a class="headerlink" href="#cassandra-write-consistency" title="Permalink to this headline">¶</a></h4>
<p>The write consistency used. Values can be <tt class="docutils literal"><span class="pre">"ONE"</span></tt>, <tt class="docutils literal"><span class="pre">"QUORUM"</span></tt> or <tt class="docutils literal"><span class="pre">"ALL"</span></tt>.</p>
</div>
<div class="section" id="cassandra-detailed-mode">
<span id="std:setting-CASSANDRA_DETAILED_MODE"></span><h4>CASSANDRA_DETAILED_MODE<a class="headerlink" href="#cassandra-detailed-mode" title="Permalink to this headline">¶</a></h4>
<p>Enable or disable detailed mode. Default is <tt class="xref py py-const docutils literal"><span class="pre">False</span></tt>.
This mode allows to use the power of Cassandra wide columns to
store all states for a task as a wide column, instead of only the last one.</p>
<p>To use this mode, you need to configure your ColumnFamily to
use the <tt class="docutils literal"><span class="pre">TimeUUID</span></tt> type as a comparator:</p>
<div class="highlight-python"><pre>create column family task_results with comparator = TimeUUIDType;</pre>
</div>
</div>
<div class="section" id="id4">
<h4>Example configuration<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h4>
<div class="highlight-python"><div class="highlight"><pre><span class="n">CASSANDRA_SERVERS</span> <span class="o">=</span> <span class="p">[</span><span class="s">"localhost:9160"</span><span class="p">]</span>
<span class="n">CASSANDRA_KEYSPACE</span> <span class="o">=</span> <span class="s">"celery"</span>
<span class="n">CASSANDRA_COLUMN_FAMILY</span> <span class="o">=</span> <span class="s">"task_results"</span>
<span class="n">CASSANDRA_READ_CONSISTENCY</span> <span class="o">=</span> <span class="s">"ONE"</span>
<span class="n">CASSANDRA_WRITE_CONSISTENCY</span> <span class="o">=</span> <span class="s">"ONE"</span>
<span class="n">CASSANDRA_DETAILED_MODE</span> <span class="o">=</span> <span class="bp">True</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="message-routing">
<span id="conf-messaging"></span><h3><a class="toc-backref" href="#id18">Message Routing</a><a class="headerlink" href="#message-routing" title="Permalink to this headline">¶</a></h3>
<span class="target" id="conf-messaging-routing"></span><div class="section" id="celery-queues">
<span id="std:setting-CELERY_QUEUES"></span><h4>CELERY_QUEUES<a class="headerlink" href="#celery-queues" title="Permalink to this headline">¶</a></h4>
<p>The mapping of queues the worker consumes from. This is a dictionary
of queue name/options. See <a class="reference internal" href="userguide/routing.html#guide-routing"><em>Routing Tasks</em></a> for more information.</p>
<p>The default is a queue/exchange/binding key of <cite>“celery”</cite>, with
exchange type <cite>direct</cite>.</p>
<p>You don’t have to care about this unless you want custom routing facilities.</p>
</div>
<div class="section" id="celery-routes">
<span id="std:setting-CELERY_ROUTES"></span><h4>CELERY_ROUTES<a class="headerlink" href="#celery-routes" title="Permalink to this headline">¶</a></h4>
<p>A list of routers, or a single router used to route tasks to queues.
When deciding the final destination of a task the routers are consulted
in order. See <a class="reference internal" href="userguide/routing.html#routers"><em>Routers</em></a> for more information.</p>
</div>
<div class="section" id="celery-create-missing-queues">
<span id="std:setting-CELERY_CREATE_MISSING_QUEUES"></span><h4>CELERY_CREATE_MISSING_QUEUES<a class="headerlink" href="#celery-create-missing-queues" title="Permalink to this headline">¶</a></h4>
<p>If enabled (default), any queues specified that is not defined in
<a class="reference internal" href="#std:setting-CELERY_QUEUES"><tt class="xref std std-setting docutils literal"><span class="pre">CELERY_QUEUES</span></tt></a> will be automatically created. See
<a class="reference internal" href="userguide/routing.html#routing-automatic"><em>Automatic routing</em></a>.</p>
</div>
<div class="section" id="celery-default-queue">
<span id="std:setting-CELERY_DEFAULT_QUEUE"></span><h4>CELERY_DEFAULT_QUEUE<a class="headerlink" href="#celery-default-queue" title="Permalink to this headline">¶</a></h4>
<p>The queue used by default, if no custom queue is specified. This queue must
be listed in <a class="reference internal" href="#std:setting-CELERY_QUEUES"><tt class="xref std std-setting docutils literal"><span class="pre">CELERY_QUEUES</span></tt></a>. The default is: <cite>celery</cite>.</p>
<div class="admonition-see-also admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="userguide/routing.html#routing-changing-default-queue"><em>Changing the name of the default queue</em></a></p>
</div>
</div>
<div class="section" id="celery-default-exchange">
<span id="std:setting-CELERY_DEFAULT_EXCHANGE"></span><h4>CELERY_DEFAULT_EXCHANGE<a class="headerlink" href="#celery-default-exchange" title="Permalink to this headline">¶</a></h4>
<p>Name of the default exchange to use when no custom exchange is
specified. The default is: <cite>celery</cite>.</p>
</div>
<div class="section" id="celery-default-exchange-type">
<span id="std:setting-CELERY_DEFAULT_EXCHANGE_TYPE"></span><h4>CELERY_DEFAULT_EXCHANGE_TYPE<a class="headerlink" href="#celery-default-exchange-type" title="Permalink to this headline">¶</a></h4>
<p>Default exchange type used when no custom exchange is specified.
The default is: <cite>direct</cite>.</p>
</div>
<div class="section" id="celery-default-routing-key">
<span id="std:setting-CELERY_DEFAULT_ROUTING_KEY"></span><h4>CELERY_DEFAULT_ROUTING_KEY<a class="headerlink" href="#celery-default-routing-key" title="Permalink to this headline">¶</a></h4>
<p>The default routing key used when sending tasks.
The default is: <cite>celery</cite>.</p>
</div>
<div class="section" id="celery-default-delivery-mode">
<span id="std:setting-CELERY_DEFAULT_DELIVERY_MODE"></span><h4>CELERY_DEFAULT_DELIVERY_MODE<a class="headerlink" href="#celery-default-delivery-mode" title="Permalink to this headline">¶</a></h4>
<p>Can be <cite>transient</cite> or <cite>persistent</cite>. The default is to send
persistent messages.</p>
</div>
</div>
<div class="section" id="broker-settings">
<span id="conf-broker-settings"></span><h3><a class="toc-backref" href="#id19">Broker Settings</a><a class="headerlink" href="#broker-settings" title="Permalink to this headline">¶</a></h3>
<div class="section" id="broker-transport">
<span id="std:setting-BROKER_TRANSPORT"></span><h4>BROKER_TRANSPORT<a class="headerlink" href="#broker-transport" title="Permalink to this headline">¶</a></h4>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Aliases:</th><td class="field-body"><tt class="docutils literal"><span class="pre">BROKER_BACKEND</span></tt></td>
</tr>
<tr class="field-even field"><th class="field-name" colspan="2">Deprecated aliases:</th></tr>
<tr class="field-even field"><td> </td><td class="field-body"><tt class="docutils literal"><span class="pre">CARROT_BACKEND</span></tt></td>
</tr>
</tbody>
</table>
<p>The Kombu transport to use. Default is <tt class="docutils literal"><span class="pre">amqplib</span></tt>.</p>
<p>You can use a custom transport class name, or select one of the
built-in transports: <tt class="docutils literal"><span class="pre">amqplib</span></tt>, <tt class="docutils literal"><span class="pre">pika</span></tt>, <tt class="docutils literal"><span class="pre">redis</span></tt>, <tt class="docutils literal"><span class="pre">beanstalk</span></tt>,
<tt class="docutils literal"><span class="pre">sqlalchemy</span></tt>, <tt class="docutils literal"><span class="pre">django</span></tt>, <tt class="docutils literal"><span class="pre">mongodb</span></tt>, <tt class="docutils literal"><span class="pre">couchdb</span></tt>.</p>
</div>
<div class="section" id="broker-url">
<span id="std:setting-BROKER_URL"></span><h4>BROKER_URL<a class="headerlink" href="#broker-url" title="Permalink to this headline">¶</a></h4>
<p>Default broker URL. This must be an URL in the form of:</p>
<div class="highlight-python"><pre>transport://userid:password@hostname:port/virtual_host</pre>
</div>
<p>Only the scheme part (<tt class="docutils literal"><span class="pre">transport://</span></tt>) is required, the rest
is optional, and defaults to the specific transports default values.</p>
<p>If this setting is defined it will override a subset of the
other <tt class="docutils literal"><span class="pre">BROKER</span></tt> options. These options are <a class="reference internal" href="#std:setting-BROKER_HOST"><tt class="xref std std-setting docutils literal"><span class="pre">BROKER_HOST</span></tt></a>,
<a class="reference internal" href="#std:setting-BROKER_USER"><tt class="xref std std-setting docutils literal"><span class="pre">BROKER_USER</span></tt></a>, <a class="reference internal" href="#std:setting-BROKER_PASSWORD"><tt class="xref std std-setting docutils literal"><span class="pre">BROKER_PASSWORD</span></tt></a>, <a class="reference internal" href="#std:setting-BROKER_PORT"><tt class="xref std std-setting docutils literal"><span class="pre">BROKER_PORT</span></tt></a>,
and <a class="reference internal" href="#std:setting-BROKER_VHOST"><tt class="xref std std-setting docutils literal"><span class="pre">BROKER_VHOST</span></tt></a>.</p>
<p>See the Kombu documentation for more information about broker URLs.</p>
</div>
<div class="section" id="broker-host">
<span id="std:setting-BROKER_HOST"></span><h4>BROKER_HOST<a class="headerlink" href="#broker-host" title="Permalink to this headline">¶</a></h4>
<p>Hostname of the broker.</p>
</div>
<div class="section" id="broker-port">
<span id="std:setting-BROKER_PORT"></span><h4>BROKER_PORT<a class="headerlink" href="#broker-port" title="Permalink to this headline">¶</a></h4>
<p>Custom port of the broker. Default is to use the default port for the
selected backend.</p>
</div>
<div class="section" id="broker-user">
<span id="std:setting-BROKER_USER"></span><h4>BROKER_USER<a class="headerlink" href="#broker-user" title="Permalink to this headline">¶</a></h4>
<p>Username to connect as.</p>
</div>
<div class="section" id="broker-password">
<span id="std:setting-BROKER_PASSWORD"></span><h4>BROKER_PASSWORD<a class="headerlink" href="#broker-password" title="Permalink to this headline">¶</a></h4>
<p>Password to connect with.</p>
</div>
<div class="section" id="broker-vhost">
<span id="std:setting-BROKER_VHOST"></span><h4>BROKER_VHOST<a class="headerlink" href="#broker-vhost" title="Permalink to this headline">¶</a></h4>
<p>Virtual host. Default is <cite>“/”</cite>.</p>
</div>
<div class="section" id="broker-use-ssl">
<span id="std:setting-BROKER_USE_SSL"></span><h4>BROKER_USE_SSL<a class="headerlink" href="#broker-use-ssl" title="Permalink to this headline">¶</a></h4>
<p>Use SSL to connect to the broker. Off by default. This may not be supported
by all transports.</p>
</div>
<div class="section" id="broker-pool-limit">
<span id="std:setting-BROKER_POOL_LIMIT"></span><h4>BROKER_POOL_LIMIT<a class="headerlink" href="#broker-pool-limit" title="Permalink to this headline">¶</a></h4>
<p class="versionadded">
<span class="versionmodified">New in version 2.3.</span></p>
<p>The maximum number of connections that can be open in the connection pool.</p>
<p>The pool is enabled by default since version 2.5, with a default limit of ten
connections. This number can be tweaked depending on the number of
threads/greenthreads (eventlet/gevent) using a connection. For example
running eventlet with 1000 greenlets that use a connection to the broker,
contention can arise and you should consider increasing the limit.</p>
<p>If set to <tt class="xref py py-const docutils literal"><span class="pre">None</span></tt> or 0 the connection pool will be disabled and
connections will be established and closed for every use.</p>
<p>Default (since 2.5) is to use a pool of 10 connections.</p>
</div>
<div class="section" id="broker-connection-timeout">
<span id="std:setting-BROKER_CONNECTION_TIMEOUT"></span><h4>BROKER_CONNECTION_TIMEOUT<a class="headerlink" href="#broker-connection-timeout" title="Permalink to this headline">¶</a></h4>
<p>The default timeout in seconds before we give up establishing a connection
to the AMQP server. Default is 4 seconds.</p>
</div>
<div class="section" id="broker-connection-retry">
<span id="std:setting-BROKER_CONNECTION_RETRY"></span><h4>BROKER_CONNECTION_RETRY<a class="headerlink" href="#broker-connection-retry" title="Permalink to this headline">¶</a></h4>
<p>Automatically try to re-establish the connection to the AMQP broker if lost.</p>
<p>The time between retries is increased for each retry, and is
not exhausted before <a class="reference internal" href="#std:setting-BROKER_CONNECTION_MAX_RETRIES"><tt class="xref std std-setting docutils literal"><span class="pre">BROKER_CONNECTION_MAX_RETRIES</span></tt></a> is
exceeded.</p>
<p>This behavior is on by default.</p>
</div>
<div class="section" id="broker-connection-max-retries">
<span id="std:setting-BROKER_CONNECTION_MAX_RETRIES"></span><h4>BROKER_CONNECTION_MAX_RETRIES<a class="headerlink" href="#broker-connection-max-retries" title="Permalink to this headline">¶</a></h4>
<p>Maximum number of retries before we give up re-establishing a connection
to the AMQP broker.</p>
<p>If this is set to <tt class="xref py py-const docutils literal"><span class="pre">0</span></tt> or <tt class="xref py py-const docutils literal"><span class="pre">None</span></tt>, we will retry forever.</p>
<p>Default is 100 retries.</p>
</div>
<div class="section" id="broker-transport-options">
<span id="std:setting-BROKER_TRANSPORT_OPTIONS"></span><h4>BROKER_TRANSPORT_OPTIONS<a class="headerlink" href="#broker-transport-options" title="Permalink to this headline">¶</a></h4>
<p class="versionadded">
<span class="versionmodified">New in version 2.2.</span></p>
<p>A dict of additional options passed to the underlying transport.</p>
<p>See your transport user manual for supported options (if any).</p>
</div>
</div>
<div class="section" id="task-execution-settings">
<span id="conf-task-execution"></span><h3><a class="toc-backref" href="#id20">Task execution settings</a><a class="headerlink" href="#task-execution-settings" title="Permalink to this headline">¶</a></h3>
<div class="section" id="celery-always-eager">
<span id="std:setting-CELERY_ALWAYS_EAGER"></span><h4>CELERY_ALWAYS_EAGER<a class="headerlink" href="#celery-always-eager" title="Permalink to this headline">¶</a></h4>
<p>If this is <tt class="xref py py-const docutils literal"><span class="pre">True</span></tt>, all tasks will be executed locally by blocking until
the task returns. <tt class="docutils literal"><span class="pre">apply_async()</span></tt> and <tt class="docutils literal"><span class="pre">Task.delay()</span></tt> will return
an <a class="reference internal" href="reference/celery.result.html#celery.result.EagerResult" title="celery.result.EagerResult"><tt class="xref py py-class docutils literal"><span class="pre">EagerResult</span></tt></a> instance, which emulates the API
and behavior of <a class="reference internal" href="reference/celery.result.html#celery.result.AsyncResult" title="celery.result.AsyncResult"><tt class="xref py py-class docutils literal"><span class="pre">AsyncResult</span></tt></a>, except the result
is already evaluated.</p>
<p>That is, tasks will be executed locally instead of being sent to
the queue.</p>
</div>
<div class="section" id="celery-eager-propagates-exceptions">
<span id="std:setting-CELERY_EAGER_PROPAGATES_EXCEPTIONS"></span><h4>CELERY_EAGER_PROPAGATES_EXCEPTIONS<a class="headerlink" href="#celery-eager-propagates-exceptions" title="Permalink to this headline">¶</a></h4>
<p>If this is <tt class="xref py py-const docutils literal"><span class="pre">True</span></tt>, eagerly executed tasks (applied by <cite>task.apply()</cite>,
or when the <a class="reference internal" href="#std:setting-CELERY_ALWAYS_EAGER"><tt class="xref std std-setting docutils literal"><span class="pre">CELERY_ALWAYS_EAGER</span></tt></a> setting is enabled), will
propagate exceptions.</p>
<p>It’s the same as always running <tt class="docutils literal"><span class="pre">apply()</span></tt> with <tt class="docutils literal"><span class="pre">throw=True</span></tt>.</p>
</div>
<div class="section" id="celery-ignore-result">
<span id="std:setting-CELERY_IGNORE_RESULT"></span><h4>CELERY_IGNORE_RESULT<a class="headerlink" href="#celery-ignore-result" title="Permalink to this headline">¶</a></h4>
<p>Whether to store the task return values or not (tombstones).
If you still want to store errors, just not successful return values,
you can set <a class="reference internal" href="#std:setting-CELERY_STORE_ERRORS_EVEN_IF_IGNORED"><tt class="xref std std-setting docutils literal"><span class="pre">CELERY_STORE_ERRORS_EVEN_IF_IGNORED</span></tt></a>.</p>
</div>
<div class="section" id="celery-message-compression">
<span id="std:setting-CELERY_MESSAGE_COMPRESSION"></span><h4>CELERY_MESSAGE_COMPRESSION<a class="headerlink" href="#celery-message-compression" title="Permalink to this headline">¶</a></h4>
<p>Default compression used for task messages.
Can be <tt class="docutils literal"><span class="pre">"gzip"</span></tt>, <tt class="docutils literal"><span class="pre">"bzip2"</span></tt> (if available), or any custom
compression schemes registered in the Kombu compression registry.</p>
<p>The default is to send uncompressed messages.</p>
</div>
<div class="section" id="celery-task-result-expires">
<span id="std:setting-CELERY_TASK_RESULT_EXPIRES"></span><h4>CELERY_TASK_RESULT_EXPIRES<a class="headerlink" href="#celery-task-result-expires" title="Permalink to this headline">¶</a></h4>
<p>Time (in seconds, or a <a class="reference external" href="http://docs.python.org/dev/library/datetime.html#datetime.timedelta" title="(in Python v3.3)"><tt class="xref py py-class docutils literal"><span class="pre">timedelta</span></tt></a> object) for when after
stored task tombstones will be deleted.</p>
<p>A built-in periodic task will delete the results after this time
(<tt class="xref py py-class docutils literal"><span class="pre">celery.task.backend_cleanup</span></tt>).</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>For the moment this only works with the amqp, database, cache, redis and MongoDB
backends.</p>
<p class="last">When using the database or MongoDB backends, <cite>celerybeat</cite> must be
running for the results to be expired.</p>
</div>
</div>
<div class="section" id="celery-max-cached-results">
<span id="std:setting-CELERY_MAX_CACHED_RESULTS"></span><h4>CELERY_MAX_CACHED_RESULTS<a class="headerlink" href="#celery-max-cached-results" title="Permalink to this headline">¶</a></h4>
<p>Result backends caches ready results used by the client.</p>
<p>This is the total number of results to cache before older results are evicted.
The default is 5000.</p>
</div>
<div class="section" id="celery-track-started">
<span id="std:setting-CELERY_TRACK_STARTED"></span><h4>CELERY_TRACK_STARTED<a class="headerlink" href="#celery-track-started" title="Permalink to this headline">¶</a></h4>
<p>If <tt class="xref py py-const docutils literal"><span class="pre">True</span></tt> the task will report its status as “started” when the
task is executed by a worker. The default value is <tt class="xref py py-const docutils literal"><span class="pre">False</span></tt> as
the normal behaviour is to not report that level of granularity. Tasks
are either pending, finished, or waiting to be retried. Having a “started”
state can be useful for when there are long running tasks and there is a
need to report which task is currently running.</p>
</div>
<div class="section" id="celery-task-serializer">
<span id="std:setting-CELERY_TASK_SERIALIZER"></span><h4>CELERY_TASK_SERIALIZER<a class="headerlink" href="#celery-task-serializer" title="Permalink to this headline">¶</a></h4>
<p>A string identifying the default serialization method to use. Can be
<cite>pickle</cite> (default), <cite>json</cite>, <cite>yaml</cite>, <cite>msgpack</cite> or any custom serialization
methods that have been registered with <tt class="xref py py-mod docutils literal"><span class="pre">kombu.serialization.registry</span></tt>.</p>
<div class="admonition-see-also admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="userguide/executing.html#executing-serializers"><em>Serializers</em></a>.</p>
</div>
</div>
<div class="section" id="celery-task-publish-retry">
<span id="std:setting-CELERY_TASK_PUBLISH_RETRY"></span><h4>CELERY_TASK_PUBLISH_RETRY<a class="headerlink" href="#celery-task-publish-retry" title="Permalink to this headline">¶</a></h4>
<p class="versionadded">
<span class="versionmodified">New in version 2.2.</span></p>
<p>Decides if publishing task messages will be retried in the case
of connection loss or other connection errors.
See also <a class="reference internal" href="#std:setting-CELERY_TASK_PUBLISH_RETRY_POLICY"><tt class="xref std std-setting docutils literal"><span class="pre">CELERY_TASK_PUBLISH_RETRY_POLICY</span></tt></a>.</p>
<p>Disabled by default.</p>
</div>
<div class="section" id="celery-task-publish-retry-policy">
<span id="std:setting-CELERY_TASK_PUBLISH_RETRY_POLICY"></span><h4>CELERY_TASK_PUBLISH_RETRY_POLICY<a class="headerlink" href="#celery-task-publish-retry-policy" title="Permalink to this headline">¶</a></h4>
<p class="versionadded">
<span class="versionmodified">New in version 2.2.</span></p>
<p>Defines the default policy when retrying publishing a task message in
the case of connection loss or other connection errors.</p>
<p>This is a mapping that must contain the following keys:</p>
<blockquote>
<div><ul>
<li><p class="first"><cite>max_retries</cite></p>
<blockquote>
<div><p>Maximum number of retries before giving up, in this case the
exception that caused the retry to fail will be raised.</p>
<p>A value of 0 or <tt class="xref py py-const docutils literal"><span class="pre">None</span></tt> means it will retry forever.</p>
<p>The default is to retry 3 times.</p>
</div></blockquote>
</li>
<li><p class="first"><cite>interval_start</cite></p>
<blockquote>
<div><p>Defines the number of seconds (float or integer) to wait between
retries. Default is 0, which means the first retry will be
instantaneous.</p>
</div></blockquote>
</li>
<li><p class="first"><cite>interval_step</cite></p>
<blockquote>
<div><p>On each consecutive retry this number will be added to the retry
delay (float or integer). Default is 0.2.</p>
</div></blockquote>
</li>
<li><p class="first"><cite>interval_max</cite></p>
<blockquote>
<div><p>Maximum number of seconds (float or integer) to wait between
retries. Default is 0.2.</p>
</div></blockquote>
</li>
</ul>
</div></blockquote>
<p>With the default policy of:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">{</span><span class="s">"max_retries"</span><span class="p">:</span> <span class="mi">3</span><span class="p">,</span>
<span class="s">"interval_start"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="s">"interval_step"</span><span class="p">:</span> <span class="mf">0.2</span><span class="p">,</span>
<span class="s">"interval_max"</span><span class="p">:</span> <span class="mf">0.2</span><span class="p">}</span>
</pre></div>
</div>
<p>the maximum time spent retrying will be 0.4 seconds. It is set relatively
short by default because a connection failure could lead to a retry pile effect
if the broker connection is down: e.g. many web server processes waiting
to retry blocking other incoming requests.</p>
</div>
<div class="section" id="celery-default-rate-limit">
<span id="std:setting-CELERY_DEFAULT_RATE_LIMIT"></span><h4>CELERY_DEFAULT_RATE_LIMIT<a class="headerlink" href="#celery-default-rate-limit" title="Permalink to this headline">¶</a></h4>
<p>The global default rate limit for tasks.</p>
<p>This value is used for tasks that does not have a custom rate limit
The default is no rate limit.</p>
</div>
<div class="section" id="celery-disable-rate-limits">
<span id="std:setting-CELERY_DISABLE_RATE_LIMITS"></span><h4>CELERY_DISABLE_RATE_LIMITS<a class="headerlink" href="#celery-disable-rate-limits" title="Permalink to this headline">¶</a></h4>
<p>Disable all rate limits, even if tasks has explicit rate limits set.</p>
</div>
<div class="section" id="celery-acks-late">
<span id="std:setting-CELERY_ACKS_LATE"></span><h4>CELERY_ACKS_LATE<a class="headerlink" href="#celery-acks-late" title="Permalink to this headline">¶</a></h4>
<p>Late ack means the task messages will be acknowledged <strong>after</strong> the task
has been executed, not <em>just before</em>, which is the default behavior.</p>
<div class="admonition-see-also admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">FAQ: <a class="reference internal" href="faq.html#faq-acks-late-vs-retry"><em>Should I use retry or acks_late?</em></a>.</p>
</div>
</div>
</div>
<div class="section" id="worker-celeryd">
<span id="conf-celeryd"></span><h3><a class="toc-backref" href="#id21">Worker: celeryd</a><a class="headerlink" href="#worker-celeryd" title="Permalink to this headline">¶</a></h3>
<div class="section" id="celery-imports">
<span id="std:setting-CELERY_IMPORTS"></span><h4>CELERY_IMPORTS<a class="headerlink" href="#celery-imports" title="Permalink to this headline">¶</a></h4>
<p>A sequence of modules to import when the celery daemon starts.</p>
<p>This is used to specify the task modules to import, but also
to import signal handlers and additional remote control commands, etc.</p>
</div>
<div class="section" id="celeryd-force-execv">
<span id="std:setting-CELERYD_FORCE_EXECV"></span><h4>CELERYD_FORCE_EXECV<a class="headerlink" href="#celeryd-force-execv" title="Permalink to this headline">¶</a></h4>
<p>On Unix the processes pool will fork, so that child processes
start with the same memory as the parent process.</p>
<p>This can cause problems as there is a known deadlock condition
with pthread locking primitives when <cite>fork()</cite> is combined with threads.</p>
<p>You should enable this setting if you are experiencing hangs (deadlocks),
especially in combination with time limits or having a max tasks per child limit.</p>
<p>This option will be enabled by default in a later version.</p>
<p>This is not a problem on Windows, as it does not have <cite>fork()</cite>.</p>
</div>
<div class="section" id="celeryd-worker-lost-wait">
<span id="std:setting-CELERYD_WORKER_LOST_WAIT"></span><h4>CELERYD_WORKER_LOST_WAIT<a class="headerlink" href="#celeryd-worker-lost-wait" title="Permalink to this headline">¶</a></h4>
<p>In some cases a worker may be killed without proper cleanup,
and the worker may have published a result before terminating.
This value specifies how long we wait for any missing results before
raising a <tt class="xref py py-exc docutils literal"><span class="pre">WorkerLostError</span></tt> exception.</p>
<p>Default is 10.0</p>
</div>
<div class="section" id="celeryd-max-tasks-per-child">
<span id="std:setting-CELERYD_MAX_TASKS_PER_CHILD"></span><h4>CELERYD_MAX_TASKS_PER_CHILD<a class="headerlink" href="#celeryd-max-tasks-per-child" title="Permalink to this headline">¶</a></h4>
<p>Maximum number of tasks a pool worker process can execute before
it’s replaced with a new one. Default is no limit.</p>
</div>
<div class="section" id="celeryd-task-time-limit">
<span id="std:setting-CELERYD_TASK_TIME_LIMIT"></span><h4>CELERYD_TASK_TIME_LIMIT<a class="headerlink" href="#celeryd-task-time-limit" title="Permalink to this headline">¶</a></h4>
<p>Task hard time limit in seconds. The worker processing the task will
be killed and replaced with a new one when this is exceeded.</p>
</div>
<div class="section" id="celeryd-task-soft-time-limit">
<span id="std:setting-CELERYD_TASK_SOFT_TIME_LIMIT"></span><h4>CELERYD_TASK_SOFT_TIME_LIMIT<a class="headerlink" href="#celeryd-task-soft-time-limit" title="Permalink to this headline">¶</a></h4>
<p>Task soft time limit in seconds.</p>
<p>The <tt class="xref py py-exc docutils literal"><span class="pre">SoftTimeLimitExceeded</span></tt> exception will be
raised when this is exceeded. The task can catch this to
e.g. clean up before the hard time limit comes.</p>
<p>Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">celery.exceptions</span> <span class="kn">import</span> <span class="n">SoftTimeLimitExceeded</span>
<span class="nd">@celery.task</span>
<span class="k">def</span> <span class="nf">mytask</span><span class="p">():</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">return</span> <span class="n">do_work</span><span class="p">()</span>
<span class="k">except</span> <span class="n">SoftTimeLimitExceeded</span><span class="p">:</span>
<span class="n">cleanup_in_a_hurry</span><span class="p">()</span>
</pre></div>
</div>
</div>
<div class="section" id="celery-store-errors-even-if-ignored">
<span id="std:setting-CELERY_STORE_ERRORS_EVEN_IF_IGNORED"></span><h4>CELERY_STORE_ERRORS_EVEN_IF_IGNORED<a class="headerlink" href="#celery-store-errors-even-if-ignored" title="Permalink to this headline">¶</a></h4>
<p>If set, the worker stores all task errors in the result store even if
<tt class="xref py py-attr docutils literal"><span class="pre">Task.ignore_result</span></tt> is on.</p>
</div>
<div class="section" id="celeryd-state-db">
<span id="std:setting-CELERYD_STATE_DB"></span><h4>CELERYD_STATE_DB<a class="headerlink" href="#celeryd-state-db" title="Permalink to this headline">¶</a></h4>
<p>Name of the file used to stores persistent worker state (like revoked tasks).
Can be a relative or absolute path, but be aware that the suffix <cite>.db</cite>
may be appended to the file name (depending on Python version).</p>
<p>Can also be set via the <em class="xref std std-option">--statedb</em> argument to
<a class="reference internal" href="reference/celery.bin.celeryd.html#module-celery.bin.celeryd" title="celery.bin.celeryd"><tt class="xref py py-mod docutils literal"><span class="pre">celeryd</span></tt></a>.</p>
<p>Not enabled by default.</p>
</div>
<div class="section" id="celeryd-eta-scheduler-precision">
<span id="std:setting-CELERYD_ETA_SCHEDULER_PRECISION"></span><h4>CELERYD_ETA_SCHEDULER_PRECISION<a class="headerlink" href="#celeryd-eta-scheduler-precision" title="Permalink to this headline">¶</a></h4>
<p>Set the maximum time in seconds that the ETA scheduler can sleep between
rechecking the schedule. Default is 1 second.</p>
<p>Setting this value to 1 second means the schedulers precision will
be 1 second. If you need near millisecond precision you can set this to 0.1.</p>
</div>
</div>
<div class="section" id="error-e-mails">
<span id="conf-error-mails"></span><h3><a class="toc-backref" href="#id22">Error E-Mails</a><a class="headerlink" href="#error-e-mails" title="Permalink to this headline">¶</a></h3>
<div class="section" id="celery-send-task-error-emails">
<span id="std:setting-CELERY_SEND_TASK_ERROR_EMAILS"></span><h4>CELERY_SEND_TASK_ERROR_EMAILS<a class="headerlink" href="#celery-send-task-error-emails" title="Permalink to this headline">¶</a></h4>
<p>The default value for the <cite>Task.send_error_emails</cite> attribute, which if
set to <tt class="xref py py-const docutils literal"><span class="pre">True</span></tt> means errors occurring during task execution will be
sent to <a class="reference internal" href="#std:setting-ADMINS"><tt class="xref std std-setting docutils literal"><span class="pre">ADMINS</span></tt></a> by email.</p>
<p>Disabled by default.</p>
</div>
<div class="section" id="admins">
<span id="std:setting-ADMINS"></span><h4>ADMINS<a class="headerlink" href="#admins" title="Permalink to this headline">¶</a></h4>
<p>List of <cite>(name, email_address)</cite> tuples for the administrators that should
receive error emails.</p>
</div>
<div class="section" id="server-email">
<span id="std:setting-SERVER_EMAIL"></span><h4>SERVER_EMAIL<a class="headerlink" href="#server-email" title="Permalink to this headline">¶</a></h4>
<p>The email address this worker sends emails from.
Default is <a class="reference external" href="mailto:celery%40localhost">celery<span>@</span>localhost</a>.</p>
</div>
<div class="section" id="email-host">
<span id="std:setting-EMAIL_HOST"></span><h4>EMAIL_HOST<a class="headerlink" href="#email-host" title="Permalink to this headline">¶</a></h4>
<p>The mail server to use. Default is <cite>“localhost”</cite>.</p>
</div>
<div class="section" id="email-host-user">
<span id="std:setting-EMAIL_HOST_USER"></span><h4>EMAIL_HOST_USER<a class="headerlink" href="#email-host-user" title="Permalink to this headline">¶</a></h4>
<p>User name (if required) to log on to the mail server with.</p>
</div>
<div class="section" id="email-host-password">
<span id="std:setting-EMAIL_HOST_PASSWORD"></span><h4>EMAIL_HOST_PASSWORD<a class="headerlink" href="#email-host-password" title="Permalink to this headline">¶</a></h4>
<p>Password (if required) to log on to the mail server with.</p>
</div>
<div class="section" id="email-port">
<span id="std:setting-EMAIL_PORT"></span><h4>EMAIL_PORT<a class="headerlink" href="#email-port" title="Permalink to this headline">¶</a></h4>
<p>The port the mail server is listening on. Default is <cite>25</cite>.</p>
</div>
<div class="section" id="email-use-ssl">
<span id="std:setting-EMAIL_USE_SSL"></span><h4>EMAIL_USE_SSL<a class="headerlink" href="#email-use-ssl" title="Permalink to this headline">¶</a></h4>
<p>Use SSL when connecting to the SMTP server. Disabled by default.</p>
</div>
<div class="section" id="email-use-tls">
<span id="std:setting-EMAIL_USE_TLS"></span><h4>EMAIL_USE_TLS<a class="headerlink" href="#email-use-tls" title="Permalink to this headline">¶</a></h4>
<p>Use TLS when connecting to the SMTP server. Disabled by default.</p>
</div>
<div class="section" id="email-timeout">
<span id="std:setting-EMAIL_TIMEOUT"></span><h4>EMAIL_TIMEOUT<a class="headerlink" href="#email-timeout" title="Permalink to this headline">¶</a></h4>
<p>Timeout in seconds for when we give up trying to connect
to the SMTP server when sending emails.</p>
<p>The default is 2 seconds.</p>
</div>
<div class="section" id="example-e-mail-configuration">
<span id="conf-example-error-mail-config"></span><h4>Example E-Mail configuration<a class="headerlink" href="#example-e-mail-configuration" title="Permalink to this headline">¶</a></h4>
<p>This configuration enables the sending of error emails to
<a class="reference external" href="mailto:george%40vandelay.com">george<span>@</span>vandelay<span>.</span>com</a> and <a class="reference external" href="mailto:kramer%40vandelay.com">kramer<span>@</span>vandelay<span>.</span>com</a>:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c"># Enables error emails.</span>
<span class="n">CELERY_SEND_TASK_ERROR_EMAILS</span> <span class="o">=</span> <span class="bp">True</span>
<span class="c"># Name and email addresses of recipients</span>
<span class="n">ADMINS</span> <span class="o">=</span> <span class="p">(</span>
<span class="p">(</span><span class="s">"George Costanza"</span><span class="p">,</span> <span class="s">"[email protected]"</span><span class="p">),</span>
<span class="p">(</span><span class="s">"Cosmo Kramer"</span><span class="p">,</span> <span class="s">"[email protected]"</span><span class="p">),</span>
<span class="p">)</span>
<span class="c"># Email address used as sender (From field).</span>
<span class="n">SERVER_EMAIL</span> <span class="o">=</span> <span class="s">"[email protected]"</span>
<span class="c"># Mailserver configuration</span>
<span class="n">EMAIL_HOST</span> <span class="o">=</span> <span class="s">"mail.vandelay.com"</span>
<span class="n">EMAIL_PORT</span> <span class="o">=</span> <span class="mi">25</span>
<span class="c"># EMAIL_HOST_USER = "servers"</span>
<span class="c"># EMAIL_HOST_PASSWORD = "s3cr3t"</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="events">
<span id="conf-events"></span><h3><a class="toc-backref" href="#id23">Events</a><a class="headerlink" href="#events" title="Permalink to this headline">¶</a></h3>