How to run my django app and celery simultaneously?

I have django web app which I deploy in railway.app. My app using celery + redis to run tasks. In my local machine I have two commands for run my app and celery separately in Makefile: PORT ?= 8000 start: poetry run gunicorn -w 5 -b 0.0.0.0:$(PORT) site_checker.wsgi:application celery: poetry run celery -A site_checker worker --loglevel=info
However, in the railway.app settings, I can only specify one start command. What is the best way to run both my app and Celery simultaneously? id: 6bdec234-7b62-42c0-9818-25372e1f4e09
5 Replies
Percy
Percy16mo ago
Project ID: 6bdec234-7b62-42c0-9818-25372e1f4e09
JustJake
JustJake16mo ago
You need to split this into multiple services. Setup one for web, and one for the celery queue
<Youssef-Ayman/>
<Youssef-Ayman/>15mo ago
how to do that?
Evil Anya
Evil Anya10mo ago
can this method work with multiple workers? Suppose I have 4 celery workers, one way is to set 1 worker and concurrency=4. Another way is to literally run the line 4 times with 4 different queue name. For the 2nd case, does that mean I should run 4 separate service for each worker? What would the overhead in memory cost be with this method?
Brody
Brody10mo ago
one service with concurrency set to 4 will do just fine
Want results from more Discord servers?
Add your server