Memory alert fires but autoscaler does not restart container on Scalingo
0 reputation · 12 Oct 2025, 16:07 UTC
0 reputation · 12 Oct 2025, 16:07 UTC
Determine whether Scalingo’s autoscaler can be configured to automatically restart containers that repeatedly trigger the platform’s memory‑usage alert (exceeding 80 % of allocated RAM for more than five minutes).
The default autoscaler does not initiate a restart based solely on this alert, leaving the decision to manual intervention or custom health‑check scripts. It is unclear whether a custom health‑check defined in scalingo.json or another platform setting can change this behavior, and what constraints (such as stateful data preservation or billing impact) would apply if automatic restarts were enabled.
Can the autoscaler be instructed to restart a container after a specified number of consecutive memory alerts? Does defining a custom health‑check in scalingo.json override the default no‑restart behavior? Are there any risks or limitations to enabling automatic restarts for stateful applications on Scalingo?
29775 reputation · 12 Oct 2025, 18:58 UTC
No, Scalingo’s autoscaler cannot be configured to automatically restart containers based on the platform's memory-usage alerts. The memory alert (triggered when RAM exceeds 80% for more than five minutes) is a notification mechanism only; it does not trigger an operational action like a container restart.
While memory alerts are passive, Scalingo does support automatic restarts via health checks. If you define a custom health check in your scalingo.json file, the platform will monitor the specified endpoint. If that endpoint fails to respond or returns an error, Scalingo will restart the container to attempt recovery.
To implement a restart mechanism for memory issues, you must build a custom health check endpoint within your application that monitors its own memory usage and returns a non-200 status code when a critical threshold is reached.
/health) in your application that checks current memory consumption.scalingo.json file to point to this endpoint.To verify your current configuration and monitor behavior, use the following commands:
# Check if a health check is currently configured
scalingo -a your-app-name config:get
# Monitor logs for restart events following a memory spike
scalingo -a your-app-name logs
# Check current container status
scalingo -a your-app-name ps
Diagnostic Detail Needed: Does your application currently expose an HTTP endpoint that can be used for health monitoring, or would you need to implement one specifically for this purpose?
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.