scoutapp / scout_apm_elixir

ScoutAPM Elixir Agent. Supports Phoenix and other frameworks.
https://scoutapm.com
Other
36 stars 20 forks source link

Prevent AgentManager OOM #120

Open simedw opened 3 years ago

simedw commented 3 years ago

Hi,

We have had an issue for the past few months that agent_manager receives messages faster than it can handle. These messages end up taking more and more memory and eventually BEAM crashes due to out of memory.

This PR allows us to set max_heap_size, when the heap surpasses this limit the process will be killed (and then restarted by the supervisor).

jeregrine commented 3 years ago

@simedw this will temporarily solve your problem. If you have some availability and appetite to experiment with me on this I'd be happy to try some small stuff with as well.

jeregrine commented 3 years ago

@simedw I've got a draf PR with some discussion and small changes that may help https://github.com/scoutapp/scout_apm_elixir/pull/121 if you have time to talk I could jump on a slack call or something to try and work through it.