Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Preserve beanstalkd queue on restart or crash

I'm using beanstalkd to managed queues. I just realised that if there are jobs in a queue and the beanstalkd process is restarted or crashes then the job is lost forever (or so I think).

Is there a way to preserve the jobs in the queue on beanstalkd failure or restart? If not, whats best practice to ensure jobs are never lost?

like image 221
Wasim Avatar asked May 27 '15 17:05

Wasim


1 Answers

Beanstalkd can be started with the -b (binary log) option, and beanstalkd will write all jobs to a binlog. If the power goes out, you can restart beanstalkd with the same option and it will recover the contents of the log.

like image 50
Alister Bulman Avatar answered Oct 10 '22 07:10

Alister Bulman