Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I have to copy my django project to another machine to perform celery tasks on it?

Here is the problem - I have a server with my django project on it.

I have to perform a lot of tasks so I use celery+rabbitmq to deal with them.

Recently I discovered that server is running out of memory so I've decided to move all tasks to another dedicated server. Following this guide I've created rabbitmq cluster without copying my django project.

I am able to send tasks to celery on my new dedicated server, however celery says that tasks are unregistered e.g.

Received unregistered task of type 'djangoapp.tasks.taskname'. The message has been ignored and discarded.

So what should I do - just copy my django project or something else?

like image 774
user1938027 Avatar asked Feb 01 '26 05:02

user1938027


1 Answers

At the very least, the code containing the tasks needs to be on box that will run them. That is, the djangoapp.tasks code needs to be there.


Naturally, all its dependencies (likely model code) and configuration (settings) will need to be there too.
You could try to save some space by only including those parts, but I really don't think it's worth it.

You should run the entire codebase (project + apps) on both servers.


For information, when you start Celery, registered tasks are displayed. You can use this to check everything is properly set-up.

like image 183
Thomas Orozco Avatar answered Feb 03 '26 17:02

Thomas Orozco



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!