Skip to content

Measure django-tasks-rq and dramatiq in the queue benchmark - #89

Merged
codingjoe merged 1 commit into
mainfrom
codingjoe-benchmark-rq-dramatiq
Oct 7, 2026
Merged

codingjoe merged 1 commit into
mainfrom
codingjoe-benchmark-rq-dramatiq

Conversation

@codingjoe

Copy link
Copy Markdown
Owner

The queue comparison still measures django-tasks-redis, which is not the RQ backend the Django ecosystem lists, and it has no dramatiq entry.

  • Replace django-tasks-redis with django-tasks-rq, draining through rqworker --burst --job-class django_tasks_rq.Job with its RQ_QUEUES mapping.
  • Add dramatiq with a broker module and a sentinel drain, celery and dramatiq reading four messages per worker thread.
  • Compare task status by value, because django-tasks-rq returns the django-tasks backport's TaskResultStatus, a different enum with the same value.
  • Grow the chart with its row count and refresh the README alt text with the new ranking.
  • Record in the harness that RQ forks a work horse per job, and that dramatiq at four messages still measures its poll backoff, which saturates around 64 messages.

django-tasks-redis leaves the comparison for django-tasks-rq, the RQ backend
of the django-tasks family, and dramatiq joins it. Both are measured on the
same trivial echo task and the same queue as the rest:

- django-tasks-rq drains with `rqworker --burst` and its own Job class. RQ's
  worker forks a work horse per job, so its 80 tasks/s includes that fork, and
  its enqueue path costs 793 tasks/s against threadmill's 7,969.
- dramatiq and celery read four messages per worker thread, celery's shipped
  prefetch multiplier. Dramatiq's Redis consumer polls rather than blocks and
  sleeps a jittered backoff once its window fills, so 669 tasks/s still
  measures that backoff more than the queue. The same worker drains 451
  tasks/s at two messages, 1,983 at 16 and 5,658 at 64, where the backoff stops
  setting the rate; its own default is two per worker thread.
- threadmill, django-tasks-db and django-tasks-rq read one task at a time,
  because their workers block on an empty queue and gain nothing from a window.

The status check compares by value, since django-tasks-rq returns the
django-tasks backport's TaskResultStatus, a different enum with the same value.
The chart grows with its row count, and the README alt text carries the new
numbers.
@codingjoe
codingjoe merged commit 27cd0ab into main Oct 7, 2026
4 checks passed
@codingjoe
codingjoe deleted the codingjoe-benchmark-rq-dramatiq branch October 7, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant