I know Laravel has a --timeout
option for their php artisan queue:listen
command, however I would like to use queue:work
instead to save some CPU usage. As far as I can tell, there isn't a way to set the timeout option with the queue worker. Will it time out if my job takes more than the 60 second default, or does the timeout just apply to queue:listen
?
I just want to make sure my jobs have enough time to run since I'm doing things like running reports in the background, and some take more than 60 seconds to generate due to the size of the dataset. It seems like they're running ok, I just want some clarification as to how that works so that I can make sure I won't run into issues.
Laravel Queue WorkersWhen we run the artisan command queue:work , we activate workers. When we changed from one job to several smaller jobs, we created ten independent workers, which means that these ten jobs will be executed like there are ten different invisible users in the background.
Jobs and QueuesThe line itself is the Queue, and each customer in the line is a Job. In order to process Jobs in the Queue you need command line processes or daemons. Think of launching a queue daemon on the command line as adding a new bank teller to the pool of available bank tellers.
Laravel Jobs are not asynchronous.
This is lower level but in the same vein you could run a command such as ps -aux | grep queue to literally view the running queue processes on whatever server your application/queue workers are running on.
the --timeout is an artificial timeout in Symphony's Process class.
If you're using supervisord, it shouldn't time out, but you might want to look at your PHP max_execution_time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With