Ruby on Rails memory leak when looping through large number of records; find_each doesn't help

前端 未结 3 999
醉酒成梦
醉酒成梦 2020-12-28 14:08

I have a Rails app that processes a large (millions) number of records in a mysql database. Once it starts working, its memory use quickly grows at a speed of 50MB per secon

3条回答
  •  梦毁少年i
    2020-12-28 14:54

    As nice as ActiveRecord is, it is not the best tool for all problems. I recommend dropping down to your native database adapter and doing the work at that level.

提交回复
热议问题