-
-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why not Celery? #8
Comments
I agree. At the moment however the features are changing almost daily, so I'll wait a little before I commit to the docs. It's barely been a month since I started this. We can use this issue to gather bullet points and discuss/improve/describe them until then.
(I could have probably made this a standalone python project, but I wanted it to be fully integrated with Django. This is key)
Although the worker itself is probably marginally faster, Django Q icreates and manages a cluster of them. Since the cluster already contains a copy of your Django environment, there is no need to create a new env for each task execution. |
I'm a long-time Celery user and now seriously considering giving Django Q a try, just waiting for the right moment but some comparison documentation would be great indeed! 👍 |
I'll see what I can come up with this weekend. |
I really think your project has a lot of potential and that part of the documentation is essential, so it's great to see that you're willing to write about it! The points you showed above are the most important IMHO, I'd just give more insight about them. It may be interesting to also get some real benchmarks. Broker support comparison could be useful as well (AFAIK Django Q only supports Redis). A security section would be also great (you already mention that it uses encryption so it could be worth mentioning it in this section). Those are some quick ideas but probably one can gather more just by looking the Celery docs. |
The problem I have, is that Celery has amassed such an immense number of features over the years that I'm not sure which one I should be comparing with. This project focuses on integration with Django, so it would be a subset anyway. Django Q's pypi source is 21 Kb, Celery is 1 Mb. I'm sure I'm missing some features. Redis is used solely for two things:
Nothing more. Memcached is not very good at the first one. RabbitMQ is pretty slow at this and would add a lot of overhead, plus it's not something most people have in their stack anyway. This leads me to the security part. Tasks (and statistics) are first serialized with Pickle into a bytestring and then signed with Django's signing module. This basically creates a checksum signature of the pickled task which is then hashed together with the task using your projects secret key. When a worker pulls a task from the queue it first decrypts the package and compares the checksum with the serialized content. So not only is it quite hard to read the data in a package for a potential hacker, also any tampering with the string would be detected. The disadvantage (or advantage) of this is that the task data on the redis server doesn't make any sense to any other software. It is a closed loop. |
I started a thread on the Django subreddit which will hopefully lead to a more comprehensive comparison. |
Doesn't run by default options, See previous point.
|
Is there someone who wants to do a benchmark comparison? I feel I'm not knowledgeable enough about Celery to do it justice in a benchmark. Also I might not be perceived as impartial. I've been doing my own performance tests with the Parzen Async example code, but I have no idea how to replicate this in Celery. Another test I often run is: def countdown(n):
while n > 0:
n -= 1
def get_username(user):
return user.username
def qtest():
u = User.objects.first()
for i in range(500):
async(countdown, 10000 * i, save=False)
async(get_username, u, save=False) This one is simple enough and puts a nice bit of strain on the workers, broker and Django backend. |
So now we have 5 dedicated broker types, plus support for several database brokers via Django ORM. Another difference I spotted is Django Q's ability to execute any python or third party library directly without decorators or pre-loading. This makes it very easy to execute shell commands for example |
IMHO this issue can be closed now that we have a good comparison that can be included somewhere more visible, which will definitely help a lot to decide what to use for newcomers (myself included). Great work! |
@Koed00 hi! Thanks for the great lib! Is django-q production-ready? |
@DataGreed currently I'm using django-q in production for 2 projects. I haven't found any problems so far, except that I have had to add the job manual in the backend. |
I've personally been using it in several commercial projects over the last 6 months or so. One of them has users in the tens of thousands and is used to send emails, live Haystack indexing, cache invalidation and handle cascading model signals. So far I've encountered very few problems. |
Another big difference with Celery that's become more obvious lately, has been AMQP's need for workers acks to be in process. With that I mean that pulling a job and acking it, has to happen in the same connection for AMQP otherwise the job is considered not acked and will be available for the next worker. This stems from AMQP's legacy as a banking protocol. |
Something I like very much about Django Q is that I can use the Django database as a broker. A reason why I like this is security. |
We are using We could have used Celery, but as a small dev team we see much appeal in small stacks, easy setup, and few dependencies. We process about 500k |
So cool to hear people actually using it besides myself :) |
Main selling point for me was django-admin integration. Plus the ORM broker, but this is secondary (for my current project, anyway). Celery has deprecated its admin integration in favor of standalone "flower" interface, which is all nice and good, but isn't what I need at the moment. |
Hello, one more interesting question (at least for me it's clear why celery is bloated for small projects) is Why not django-rq? From what I see in the docs, django-q by default uses the redis broker, so, if I don't want to use a different broker why should I choose django-q instead of the combination of rq and django-rq? Thanks ! |
@spapas after almost 2 years (yeah very slow response) |
@Eagllus better late than never :) I am using these features, yes but I'd really like to know which are the extra features that django-q offers? They may be useful for some projects! |
I'm a first time user of task-queues and am trying to consider whether I should be using Django Q or Celery or something else. Any links to discussion will be appreciated. |
👍 bump. As of today, the available discussions on the web seems to be 3-4 years old. Will be great to have a comparison between:
|
There is also a lightweight newcomer: django-simple-task. |
As @shawnngtq pointed out, an updated discussion would be great for newcomers like me. |
Ditching
Using |
tbh both Django-q and celery are great, I decided to go with DjangoQ because of simplicity and easy integration with Django. Celery requires to spin up a RabbitMQ for message handling, and I do not want to add extra complex things to manage as part of my stack... |
Co-authored-by: ethemguner
I am really interested in this package since I don't want to have to use Redis with "django-rq" but this repo hasn't received any updates in over 2 years and is still missing a basic list comparing the benefits of it vs. the alternatives. Just found there's a maintained fork of this repo! |
It would be nice if the docs contained a brief comparison with similar libs or motives behind django-q. Right now, celery is the go to system for most django developers out there. It would be nice to know what django-q intents to do differently.
Cheers.
The text was updated successfully, but these errors were encountered: