Switching to heroku cedar-14 leads to continous increase in memory consumption

后端 未结 1 1054
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-09 09:57

Heroku recently announced that cedar-10 will no longer be supported after this year in November. Switching to cedar-14 led to an increase in memory consumption until I experienc

相关标签:
1条回答
  • 2021-02-09 10:40

    Here is a nice link for your 'problem' : http://blog.codeship.com/debugging-a-memory-leak-on-heroku/

    It describe perfectly the continous increase in memory over time. The same 'problem' happen with Puma, there is also a Puma Worker Killer Gem

    One thing to note is that you can tune your garbage collector Configuration to be more agressive. Just be careful, you can mess pretty everything with a single bad configuration.

    There is -at the moment- no magic solution for this problem. We encounter it too in production, however the memory usage sometimes stabilize, just below the limit where swapping start.

    As an immediate action, we choose to reduce the number of workers per dyno, reducing it to 2, and increasing the number of dyno dynamically with HireFire.

    You have a loot of tools that can help, here is a list we use each days to track expensive queries / allocations :

    • https://github.com/brynary/rack-bug/
    • https://github.com/binarylogic/memorylogic

    Good luck, it's not a simple problem to solve and I don't think that there is a universal true solution for it right now.

    0 讨论(0)
提交回复
热议问题