Random machine stoppage

Hi, I have a quite simple machine definition in my current environment that hosts a service with long-lived WebSocket connections. The WebSocket connections are active however, they suddenly stop because the machine is terminated for “excess capacity” and sends a kill signal. This happens randomly.

I am trying to understand why this happens and how to possibly avoid it. Does anyone have any guesses about what it could be?

[[services]]
protocol = 'tcp'
internal_port = 8080
auto_stop_machines = 'stop'
auto_start_machines = true
min_machines_running = 0
processes = ['app']

[[services.ports]]
port = 8080
handlers = ['http']

[[services.tcp_checks]]
interval = '10s'
timeout = '5s'
grace_period = '20s'

[[vm]]
memory = '256mb'
cpu_kind = 'shared'
cpus = 1

Since you have min_machines_running = 0 and auto_stop_machines = ‘stop’ this will trigger the machine to automatically stop when it detects that no requests are being received.

You can set min_machines_running = 1 if you always want to have 1 machine running, or set auto_stop_machines = ‘off’.