7. Beanstalkd
How AfterShip use queue?
- Ten of millions of job per day
- Billions of job so far
- 4 beanstalkd servers (AWS m3.large)
- 4 down incidents in last 3 years
8. Beanstalkd Protocol
Characteristics
- Guarantee FIFO
- Each job is uniquely assigned to one worker.
- Each connection can only reserve one job at a time
- Support jobs persistent (“-b” option)
- Support priority, delay, ttr (time to run), bury
- No HA
10. Beanstalkd Protocol
Action you can do
Status Description
put (with delay) Add a new job in the queue
reserve Take the job from queue
delete Delete the job after reserved.
bury Bury the job after reserved.
kick Kick the job from buried status to ready status.
release (with delay) Release the job back to ready status, after reserved it.
The job id, pri, will be same.