Fueled / django-init

Project template used at Fueled for scaffolding new Django based projects. :dizzy:
Other
189 stars 46 forks source link

Fix celerybeat run dir #357

Closed vikalpj closed 5 years ago

vikalpj commented 5 years ago

Why was this change necessary?

When the server gets restarted, /var/run/celery doesn;t exist and server is on 100% CPU usage.

How does it address the problem?

systemd services creates the directly when started and removes when its stopped.

Are there any side effects?

Not known as of now

theskumar commented 5 years ago

Hi Vikalp, thanks for the PR.

Do we have doc on how the celery dir will always be created at /var/run/ , I looked around and it seems the file get at /run/.

Cheers.

theskumar commented 5 years ago

That said, I always feel that https://github.com/mixkorshun/celery-beatx would be a better alternative to filesystem based scheduler.

vikalpj commented 5 years ago

@theskumar /var/run and /run are one and the same thing. /var/run by default is a symbolic link for /run.

Let me have a look at celery-beatx and revert back.

vikalpj commented 5 years ago

IMO I would either prefer using same scheduler for small projects. for large scale project I would believe we can use one from

@theskumar thoughts?

theskumar commented 5 years ago

Thanks for the info.

I don't quite get what the advantage of django-celery over normal setup, so I can't recommend.

https://github.com/sibson/redbeat https://github.com/mixkorshun/celery-beatx

These two are most or less solve the same problem. I find beatx to be lean and simple compared to redbeat and that's why the recommendation for swapping out with filesystem beatfile with redis. This is one of things that is easier to miss while running in multi-server setup, while I think it doesn't add a lot of complication if it is available in boilerplate, even on a single server, as redis would available as celery broker.

I'll merge this now and we see if using redis would make sense in the boilerplate.

theskumar commented 5 years ago

Added https://github.com/Fueled/django-init/issues/361