简体   繁体   中英

Laravel Queue (REDIS) batch size

Is there a way to change batch size of processed ID's from redis by worker?

I'm using Redis as a queue for mysql, due to the big data import into mysql, with Laravel 5.3.

Another thing is, that I presume, it is not a good idea to overflow php here, although, I've changed php.ini memory to 512MB.

Due to the nature of redis being, as I understand, list of FIFO's in this case, is there a way to run multiple workers at once? (This could be another quesion, sorry about that)

Feel free to push me into another direction, cause I'm open to any suggestions.

Redis is pretty lightweight as a queue, I think most Laravel projects with non-trivial queue requirements use beanstalkd, which might be worth a look if you're at an early stage. You'll "pop" one message off the queue at a time so in that sense the batch size isn't configurable but you can certainly run more than one worker at one time. You can configure supervisord or whatever it is that herds the workers to run multiples of the process. There's some good suggestions in this laracasts thread as well https://laracasts.com/discuss/channels/laravel/running-multiple-queue-workers which hopefully will give you more pointers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM