Show More
@@ -1,73 +1,73 b'' | |||
|
1 | 1 | |
|
2 | 2 | .. _config-celery: |
|
3 | 3 | |
|
4 | 4 | Configure Celery |
|
5 | 5 | ---------------- |
|
6 | 6 | |
|
7 | 7 | To improve |RCM| performance you should configure and enabled Celery_ as it makes |
|
8 | 8 | asynchronous tasks work efficiently. Most important it allows sending notification |
|
9 | 9 | emails, create repository forks, and import repositories in async way. |
|
10 | 10 | |
|
11 | 11 | If you decide to use Celery you also need a working message queue. |
|
12 | 12 | The recommended message broker is rabbitmq_. |
|
13 | 13 | |
|
14 | 14 | |
|
15 | 15 | In order to have install and configure Celery, follow these steps: |
|
16 | 16 | |
|
17 | 17 | 1. Install RabbitMQ, see the documentation on the Celery website for |
|
18 | 18 | `rabbitmq installation`_. |
|
19 | ||
|
19 | 20 | 2. Configure Celery in the |
|
20 | 21 | :file:`home/{user}/.rccontrol/{instance-id}/rhodecode.ini` file. |
|
21 |
|
|
|
22 | rabbitmq_ installation:: | |
|
22 | Set the following minimal settings, that are set during rabbitmq_ installation:: | |
|
23 | 23 |
|
|
24 | 24 | broker.host = |
|
25 | 25 |
broker.vhost = |
|
26 | 26 |
|
|
27 | 27 |
|
|
28 | 28 |
|
|
29 | 29 |
|
|
30 | 30 | |
|
31 | 31 |
|
|
32 | 32 | |
|
33 | 33 | # Set this section of the ini file to match your Celery installation |
|
34 | 34 | #################################### |
|
35 | 35 | ### CELERY CONFIG #### |
|
36 | 36 | #################################### |
|
37 | 37 | ## Set to true |
|
38 | 38 | use_celery = true |
|
39 | 39 | broker.host = localhost |
|
40 | 40 | broker.vhost = rabbitmqvhost |
|
41 | 41 | broker.port = 5672 |
|
42 | 42 | broker.user = rabbitmq |
|
43 | 43 | broker.password = secret |
|
44 | 44 | |
|
45 | 45 | celery.imports = rhodecode.lib.celerylib.tasks |
|
46 | 46 | |
|
47 | 47 | celery.result.backend = amqp |
|
48 | 48 | celery.result.dburi = amqp:// |
|
49 | 49 | celery.result.serialier = json |
|
50 | 50 | |
|
51 | 51 | #celery.send.task.error.emails = true |
|
52 | 52 | #celery.amqp.task.result.expires = 18000 |
|
53 | 53 | |
|
54 | 54 | celeryd.concurrency = 2 |
|
55 | 55 | #celeryd.log.file = celeryd.log |
|
56 | 56 | celeryd.log.level = debug |
|
57 | 57 | celeryd.max.tasks.per.child = 1 |
|
58 | 58 | |
|
59 | 59 | ## tasks will never be sent to the queue, but executed locally instead. |
|
60 | 60 | celery.always.eager = false |
|
61 | 61 | |
|
62 | 62 | |
|
63 | 63 | 3. Enable celery, and install `celeryd` process script using the `enable-module`:: |
|
64 | 64 | |
|
65 | 65 | rccontrol enable-module celery {instance-id} |
|
66 | 66 | |
|
67 | 67 | |
|
68 | 68 | .. _python: http://www.python.org/ |
|
69 | 69 | .. _mercurial: http://mercurial.selenic.com/ |
|
70 | 70 | .. _celery: http://celeryproject.org/ |
|
71 | 71 | .. _rabbitmq: http://www.rabbitmq.com/ |
|
72 | 72 | .. _rabbitmq installation: http://docs.celeryproject.org/en/latest/getting-started/brokers/rabbitmq.html |
|
73 | 73 | .. _Celery installation: http://docs.celeryproject.org/en/latest/getting-started/introduction.html#bundles |
General Comments 0
You need to be logged in to leave comments.
Login now