dounianxie2058 2017-08-17 08:21
浏览 183

Laravel Queue(REDIS)批量大小

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.

  • 写回答

1条回答 默认 最新

  • dongpo1216 2017-08-17 09:29
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
  • ¥15 蓝桥oj3931,请问我错在哪里
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state