Coder Social home page Coder Social logo

frkhit / celery-redis-priority-test Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tendrid/celery-redis-priority-test

0.0 0.0 0.0 92 KB

Used to determine how priorities are working in celery with a redis backend

Python 95.03% Dockerfile 4.97%

celery-redis-priority-test's Introduction

celery-redis-priority-test

Used to determine how priorities are working in celery with a redis backend

run in docker

docker-compose up

screenshot

How to do the thing:

run celery in one shell celery worker -A tasks -Q a-high,b-medium,c-low -Ofair -c1 --prefetch-multiplier=1

and run tests in another green (i dont have pytest commented yet. will do soon)

https://medium.com/@hengfeng/how-to-route-tasks-in-celery-rabbitmq-e0e22c178e45

Undocumented, or incorrect assertions of Celery and Redis:

1: task_inherit_parent_priority is available for the Redis backend, and not just AMQP

2: Task priority is low to high, eg: tasks with a priority of 0 are handeled before 9

3: If you set the broker_transport_options to {"queue_order_strategy": "sorted"}, it will prioritize tasks from queues in alphabetical order

4: Tasks are ran in order of sorting first by task priority, and second by queue order

5: If you override task priority by setting broker_transport_options to {"priority_steps":[0, 2, 4, 6, 8]}, 0 will be the highest priority. If you invert that to {"priority_steps":[8, 6, 4, 2, 0]}, 8 will be the highest. The order of priority_steps dictates priority order.

celery-redis-priority-test's People

Contributors

fengrk avatar tendrid avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.