Autoscaling down - how/when & persistent connections

Hey! I’m doing some mind-mapping of a hypothetical SaaS-tool and trying to figure out if it’d be good on render.

It will be running in node.js and have persistent WebSocket connections; with traffic spikes I’d to be able to scale up the number of WebSocket-servers.

The question I have is, how does scale down work, and when/how is it triggered

  • How does it notify my server that it’s time for a graceful shutdown? When scaling down I’d have to notify connected clients to re-connect.
  • How long is the grace period for shutting down?

Cheers

The scaling down process is similar to our zero-downtime deployment. The application will receive SIGTERM signal first. There is a grace period of 30 seconds to shut everything down. If the application is still up after 30 seconds, it is shut down via a SIGKILL signal.