Skip to content

django-vtasks

Valkey Tasks. Very Fast Tasks.

From the team at GlitchTip, django-vtasks is a lightweight, async-first task queue for Django 6.0+, designed to bridge the gap between simplicity (database-backed) and raw performance (Valkey-backed).


Why django-vtasks?

At GlitchTip, we needed a task queue that was simpler than Celery but powerful enough for production workloads. We built django-vtasks to be:

  • Async-first - Native asyncio for high-performance I/O
  • Flexible - Start with Postgres, scale to Valkey without rewriting code
  • Lightweight - Minimal dependencies, modern codebase
  • Embedded-friendly - Run tasks in your ASGI server or as standalone workers

When to Use django-vtasks

Adopting django-vtasks is a good choice when:

  • You are using Django 6.0+ and want to leverage modern asyncio
  • You want a "Hybrid" strategy: Start with Postgres (less infrastructure) and switch to Valkey/Redis (high throughput) without rewriting task code
  • You care about efficiency: Handle thousands of concurrent I/O-bound tasks in a single process

It might not be the ideal option if:

  • You need complex workflow primitives (Chains, Chords, Groups) - Use Celery
  • You need to store Task Results (this library is strictly fire-and-forget) - Consider django-tasks
  • You rely on brokers other than Valkey or Postgres (e.g., SQS, RabbitMQ)

Features

  • Async First: Native asyncio worker for high-performance I/O. Sync fallback for synchronous tasks. Worker can run standalone or embedded in an existing asyncio loop.
  • Dual Backends:
    • Database: Simple, zero-infrastructure setup. Best with Postgres.
    • Valkey: High-throughput, low-latency using atomic BLMOVE. Compatible with Redis.
  • Batch Processing: Optional, explicit batching for high-throughput queues.
  • Scheduled Tasks: Schedule tasks to run at a specific time or interval using cron syntax.
  • Unique Tasks: Ensure tasks run just once using the unique kwarg. Supports Mutex and Throttle patterns.
  • Compression: Automatic Zstandard compression for large payloads (>1KB).
  • Serialization: Uses orjson. datetime and UUID are supported.
  • Reliability: Fail-fast DLQ with capped history for failed tasks.
  • Observability: Optional Prometheus metrics for monitoring.
  • Admin Interface: View in-progress and failed tasks via Django admin.

Admin Interface

Backend Features

Feature PostgreSQL SQLite MySQL Valkey
Concurrent Workers Yes No (1 at a time) Yes Yes
Unique (Mutex) Yes Yes No Yes
Throttling No No No Yes

Requirements

  • Python 3.12+
  • Django 6.0+
  • Valkey backend requires Valkey 7+ (or Redis 7+)

Performance

In benchmarks, django-vtasks demonstrates significant performance advantages over Celery:

  • 1.9x faster enqueue rates with async operations
  • 1.5x faster processing throughput

See Benchmarks for detailed methodology and results.

Get Started

Ready to dive in? Head to the Getting Started guide for installation and basic configuration.

Contributing

We welcome contributions! Please see our CONTRIBUTING.md for details.


Built by the GlitchTip team.