DWQA QuestionsCategory: DatabaseQ: does the laravel queue have a default execution time?
Crazy Camaro asked 2 months ago

I have written a correct way to push 50000 pieces of data. Now I take out 10 pieces of data each time and join the queue to push them. However, when I execute about 6000 pieces of data each time, I get stuck. I have to restart before I can continue to run. What’s the reason? Is there a default timeout?
Local environment xampp
This machine is equipped with 8g memory i3-4170 3.7GHz

dryyun replied 2 months ago

Is there a log?

dryyun replied 2 months ago

No, or I didn’t find it

2 Answers
ElfSundae answered 2 months ago

What do you mean stuck? Why don’t you run?
It is suggested to do the following investigation:

  • When “stuck”, check whether there are tasks waiting in the database or queue cache
  • Check if the task you added has expiredconfig/queue.phpinexpireConfiguration of
  • Check whether your task process is still running, whether it is stuck due to high CPU consumption, and whether it takes too much memory. Laravel’s default maximum memory footprint is 128 MB, which can be used to--memoryParameter specification.
  • If it is a system level unexpected termination, you can use thesupervisedAnd other tools can keep the queue alive all the time. Please refer to the official documents for details.
  • If all of the above are correct or are not sure whether they have been checked, you can use a simple and crude way to simulate your normal code to add and execute queues, and use ` artisan ‘on the command line queue:listen “To run the queue, output the sequence of each task. Whether it is successful or not, output it in the key steps.
  • It will be easier to check with unit testing