The short answer
Most indie multiplayer games are empty most of the day. A server left running 24 hours a day for a 30-day month uses 720 server hours. If your players are online for three hours a day, only 90 of those hours do anything. The other 630 are an empty room with the lights on. Idle shutdown stops the machine when nobody is playing and starts it again when someone wants to.
The arithmetic
| Pattern (one standard server, 30-day month) | Server hours used |
|---|---|
| Always on | 720 |
| On during a 6-hour evening window only | 180 |
| Players present about 3 hours a day | 90 |
| Weekend test sessions, 8 hours on two days a week | about 64 |
NetCraftGames plans include 40, 80 and 120 standard hours a month. That is deliberate: it only makes sense if empty servers are not left running, which is why pricing states there is no unlimited always-on offer.
What safe idle shutdown requires
- A real player count. The server must report how many players are connected, for example as bounded JSON from a loopback endpoint such as
/playersreturning{ "players": 2 }. If the count is unknown or stale, the idle clock resets rather than guesses. - A grace period. NetCraftGames waits for ten continuous minutes of zero players before acting, so a brief gap between matches does not tear down a server.
- Save before stop. A graceful stop sends a termination signal, waits for your configured grace seconds, uploads a snapshot, and verifies the stored copy before the machine is destroyed. If the save fails, the machine is held for protection and the incident is visible.
- Fast, safe restart. Your server must start cleanly from its saved state. Test it by stopping and starting it ten times.
What to implement in your server
- Count connections after authentication, not raw sockets.
- Handle
SIGTERM: stop accepting players, flush saves under your save path, then exit with code 0. - Write state under one folder (
/game/savesin the example manifests). - Start fast: open the port first, load heavy content after.
What idle shutdown does not do
- It does not protect you if your server reports zero players while people are connected. Test the endpoint with real clients.
- It does not replace sleeping a server explicitly. Servers that cannot report player counts must be put to sleep from the dashboard.
- It is not an anti-abuse tool. Someone holding a connection open keeps the server awake.
Frequently asked questions
How long does idle shutdown wait?
NetCraftGames waits for ten continuous minutes of zero reported players before it begins a graceful stop. If the player count is unknown or stale, the idle clock resets instead of assuming the server is empty. After the grace period the server is signalled to stop, saved, verified and then terminated.
Does shutting a server down lose my game's data?
It should not. Shutdown first stops the game, then uploads a snapshot of your declared save path, and the controller hashes the stored bytes before destroying the machine. If the save or drain fails, the machine is kept in a visible protection hold instead of being deleted. Test restart from saves before launch.