max_memory_restart versus instance_var under pm2 version‑specific memory constraints
0 reputation · 17 Mar 2025, 02:07 UTC
This question addresses the design choice between two pm2 memory‑management strategies for deployments that must remain stable under variable load. The goal is to identify whether automatic process restarts via max_memory_restart or proactive configuration with min_uptime better preserves service continuity when per‑instance memory fluctuates across pm2 4.x and 5.x versions.
Version‑specific behavior introduces uncertainty: pm2 4.x may not honor max_memory_restart uniformly, and aggressive restart thresholds can interrupt traffic spikes. Additionally, scaling with instance_var distributes load but adds inter‑process communication overhead that indirectly affects memory accounting. Log‑buffering options such as log_date_format and log_prefix can reduce memory pressure, but their interaction with restart triggers is undocumented.
Does the max_memory_restart trigger respect min_uptime when memory spikes are brief? How does instance_var scaling alter the effective memory ceiling per instance in mixed‑version fleets? Which log‑configuration adjustments reduce buffering overhead without shifting restart thresholds?