Priorities are per jobs, you can read more about this at: https://github.com/kr/beanstalkd/blob/master/doc/protocol.txt
Without job priorities, beanstalkd operates as a FIFO queue.
There are three hard facts to know about job priorities:
- Jobs with lower priority numbers are reserved before jobs with higher priority numbers.
- beanstalkd priorities are 32-bit unsigned integers (they range from 0 to 2^32 - 1).
- beanstalkd uses 2^31 as default job priority (beanstalkd.DEFAULT_PRIORITY) (the client may override this, I've seen defaults set to 1024).
Note also that within the same priority jobs are still handled in a FIFO manner. So if you have an agent that watches on multiple tubes, and when you get same priority jobs on those tubes they will get reserved in FIFO manner.
You can watch the tubes and jobs with https://github.com/ptrofimov/beanstalk_console