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