You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After some reports of memory leaking in elastic-agent-complete containers running in AWS Fargate, we've found a couple of scenarios where elastic-agent-complete would spawn unresponsive or orphaned processes:
Random scenarios where node process goes unresponsive and doesn't exit.
New Fleet integration triggers elastic-agent-issued restart when a synthetics monitor is running.
Details
NodeJS goes unresponsive and doesn't exit
On some containers used for testing, node processes go unresponsive seemingly at random. Once unresponsive, HB will block that monitor from running again, waiting for node to exit.
Even though node is unresponsive, it will continue to allocate memory over time, until an OOM is issued by the kernel or V8 reaches max heap size:
When a new Synthetics integration gets added to an agent's policy, elastic-agent triggers a restart for all beats processes. ATM, heartbeat exits without checking if there're synthetic monitors running.
Since these run under a different PID, when HB exits these node processes are orphaned and end up re-assigned as PID 1 children. These children are never destroyed and never release whatever resources are already allocated to them:
emilioalvap
changed the title
[Meta] NodeJS process leak in elastic-agent-complete
[Meta][Heartbeat] NodeJS process leak in elastic-agent-complete
Jul 18, 2022
Summary
After some reports of memory leaking in elastic-agent-complete containers running in AWS Fargate, we've found a couple of scenarios where
elastic-agent-complete
would spawn unresponsive or orphaned processes:node
process goes unresponsive and doesn't exit.elastic-agent
-issued restart when a synthetics monitor is running.Details
NodeJS goes unresponsive and doesn't exit
On some containers used for testing,
node
processes go unresponsive seemingly at random. Once unresponsive, HB will block that monitor from running again, waiting fornode
to exit.Even though
node
is unresponsive, it will continue to allocate memory over time, until an OOM is issued by the kernel or V8 reaches max heap size:Fleet integration policy update
When a new Synthetics integration gets added to an agent's policy,
elastic-agent
triggers a restart for all beats processes. ATM, heartbeat exits without checking if there're synthetic monitors running.Since these run under a different
PID
, when HB exits thesenode
processes are orphaned and end up re-assigned asPID 1
children. These children are never destroyed and never release whatever resources are already allocated to them:Tracking
These're the individual issues:
The text was updated successfully, but these errors were encountered: