memory leak in php script

后端 未结 6 751
盖世英雄少女心
盖世英雄少女心 2021-01-13 14:39

I have a php script that runs a mysql query, then loops the result, and in that loop also runs several queries:

    $sqlstr = \"SELECT * FROM user_pred WHERE         


        
6条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-13 14:49

    The best way is probably to get all userIds and flush them to a file. Then run a new script which forks with pipes to x amount of worker drones. Then just give them a small list of userIds to process as they complete each list. With multiple cpus/cores/servers you can finish the task faster. If one worker fails, just start a new one. To use other servers as workers you can call them with curl/fopen/soap/etc from a worker thread.

提交回复
热议问题