[Questions] How to do Django -> RabbitMQ > Multiple Celery Workers, each inside a docker container? #12691
-
Community Support Policy
RabbitMQ version used4.0.2 Erlang version used26.2.x Operating system (distribution) usedCentos How is RabbitMQ deployed?Debian package rabbitmq-diagnostics status outputSee https://www.rabbitmq.com/docs/cli to learn how to use rabbitmq-diagnostics
Logs from node 1 (with sensitive values edited out)See https://www.rabbitmq.com/docs/logging to learn how to collect logs
Logs from node 2 (if applicable, with sensitive values edited out)See https://www.rabbitmq.com/docs/logging to learn how to collect logs
Logs from node 3 (if applicable, with sensitive values edited out)See https://www.rabbitmq.com/docs/logging to learn how to collect logs
rabbitmq.confSee https://www.rabbitmq.com/docs/configure#config-location to learn how to find rabbitmq.conf file location
Steps to deploy RabbitMQ clusterFollow the documentation available online. Steps to reproduce the behavior in questionLaunch all services on the docker compose. advanced.configSee https://www.rabbitmq.com/docs/configure#config-location to learn how to find advanced.config file location
Application code# PASTE CODE HERE, BETWEEN BACKTICKS Kubernetes deployment file# Relevant parts of K8S deployment that demonstrate how RabbitMQ is deployed
# PASTE YAML HERE, BETWEEN BACKTICKS What problem are you trying to solve?Hello fellow developers, I have a question concerning the deployment of RabbitMQ. Currently, I have set two different computers, the first is running my django application, and the second is running Rabbit MQ and one worker written in Python(Celery). The second computer has more computational resources, it does the heavy-lifting. Now I am working on a containerized version of my web application and I would like to ask for your advise. My idea is to launch the following containers (image names in bold):
Currently, containers 1 and 2 are set up and running. The idea is that container 4 can be instantiated as many times as possible, depending on the workload of my django app. The broker would have one or many workers to work with. What's your opinion? I would really appreciate your feedback. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
As long as your apps can connect to RabbitMQ nodes, RabbitMQ does not care where they run, whether they use containers or not. See most relevant Docker documentation and what ports RabbitMQ uses. If your question is how to increase the number of application instances, the answer is "you must decide on what metrics to monitor them, say, once a minute, and scale your instances accordingly. The most common mistakes around this by far are
|
Beta Was this translation helpful? Give feedback.
@djaniel I believe my earlier response includes an answer. RabbitMQ does not care how or why or when you increase or reduce the number of consumers.
Usually this is done in response to a certain metric, such as a message backlog (in Ready state only, of course), and I have proactively provided some suggestions about what NOT to do.