I have checked my logs and ever since starting using puma (Switched from unicorn which didn't have this issue) as my web server on heroku I have what appears to be a memory leak problem.
The server itself is idle and the logs show no requests, yet my memory utilization on web dynos keeps rising to the limit and then overquota. Any ideas or suggestions on how to look into this?
Please refer to the files /sys/fs/cgroup/memory/memory. usage_in_bytes and /sys/fs/cgroup/memory/memory. limit_in_bytes . Dynos for Heroku apps run in containers while some of Linux tools, like the free command, refers to metrics from the underlying instance.
Puma works in two main modes: cluster and single. In single mode, only one Puma process boots. In cluster mode, a master process is booted, which prepares (and may boot) the application and then uses the fork() system call to create one or more child processes. These child processes all listen to the same socket.
I cannot provide an answer, but I am researching the same issue. So far, the two following links have proved most educational to me: https://github.com/puma/puma/issues/342. A possible work-around (though supposedly not vetted for Heroku production) is to use the puma-worker-killer gem: https://github.com/schneems/puma_worker_killer. Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With