0

I have a flask application that I run with Gunicorn.

The application itself would ideally be run with multiple workers. I also have some data I need to consume from Kafka, but that should only be one background task.

Is there some way I can have multiple Gunicorn workers, but only have one launch a background worker?

2
  • 1
    Gunicorn is responsible for handling http requests, why running a Kafka consumer as a worker? and what if the worker failed, will gunicorn restart this consumer? It will just replace it with another worker that doesn't know about the consumer. Commented Mar 5 at 9:36
  • Starting the Kafka consumer thread as a child of the Gunicorn worker was convenient for development, but yeah, I want to switch away from it. However, I still need Gunicorn as my entry point on account of running this in a docker container. Commented Mar 6 at 7:19

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.