Skip to content
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

Support for dramatiq #2669

Open
dekoza opened this issue Jul 8, 2020 · 2 comments
Open

Support for dramatiq #2669

dekoza opened this issue Jul 8, 2020 · 2 comments

Comments

@dekoza
Copy link

dekoza commented Jul 8, 2020

Description

I'd like to propose support for Dramatiq which is a pumped-up alternative for Celery.

Rationale

Main reasons behind Dramatiq are pointed out nicely in documentation:

  • high reliability and performance
  • simple and easy to understand core
  • convention over configuration

I think the reasoning behind it might be similar to that why traefik was chosen to replace nginx: it's better yet quite familiar.

Use case(s) / visualization(s)

Dramatiq compares favorably with Celery and others:

  Dramatiq Celery Huey RQ
Simple implementation Yes No [3] Yes Yes
Automatic retries Yes No Yes No
Reliable delivery Yes No [1] No No
Locks and rate limiting Yes No Yes No
Task prioritization Yes No [4] No No [4]
Delayed tasks Yes Yes [2] Yes No
Cronlike scheduling No [5] Yes Yes No
Chaining / Pipelining Yes Yes Yes No
Result storage Yes Yes Yes Yes
Code auto-reload Yes No No No
RabbitMQ support Yes Yes Yes No
Redis support Yes Yes Yes Yes
In-memory broker support Yes No Yes No
Greenlet support Yes Yes Yes No

Footnotes:

  1. Celery acks tasks as soon as they’re pulled by a worker by default. This is easy to change, but a bad default. Dramatiq doesn’t let you change this: tasks are only ever acked when they’re done processing.
  2. Celery has poor support for delayed tasks. Delayed tasks are put on the same queue that is used for normal tasks and they’re simply pulled into worker memory until they can be executed, making it hard to autoscale workers by queue size. Dramatiq enqueues delayed tasks on a separate queue and moves them back when they’re ready to be executed.
  3. Celery’s source code is spread across 3 different projects (celery, billiard and kombu) and it’s impenetrable. Its usage of runtime stack frame manipulation leads to heisenbugs.
  4. (1, 2) Celery and RQ don’t support task prioritization. You have to deploy multiple sets of workers in order to prioritize queues. Dramatiq lets you prioritize down to the individual actor level.
  5. For cron-like scheduling functionality, you can combine Dramatiq with APScheduler or Periodiq.
@browniebroke
Copy link
Member

Thanks for taking the time to write this, very well written!

I've heard about Dramatiq, but I've never get the chance to use it in the production environment. If the integration is not too complicated we could probably consider it as an option, but testing becomes increasingly complicated as we add more options.

So why not, provided it's something that folks are after and it's not too complicated to maintain.

(As a side note, someone suggested to include Django-Q (#2191) which I declined at the time, if we add the option Celery/Dramatiq, we could reconsider it)

@mmmcorpsvit
Copy link

investigate https://github.com/pricingassistant/mrq
very interesting project, much more speed compare with Celery, too have IO support, dashboard and etc., used redis+mongo
have some unique feature, for example use simple raw task when don't important order get tasks from store (super performance in hot projects). Have very good dashboard (charts, logs of tasks, rerun tasks etc.). Not depend on Django, can easy use in Flask example or on pure project. Simple sources, can overide task run.

i use in production, very cool, try (use git clone not release download!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants