Graceful shutdown means stopping a server cleanly when it receives a termination signal — finishing in-flight requests, closing connections (DB, etc.), and releasing resources — instead of abruptly killing it and dropping active work. It's essential for zero-downtime deploys and reliability.
Why abrupt shutdown is a problem
Without graceful shutdown, when the process is killed (deploy, scale-down, crash):
✗ In-flight requests are dropped → users get errors
✗ DB transactions left incomplete
✗ Connections not closed cleanly → leaks/locks
During deploys and autoscaling, processes are stopped constantly — doing it cleanly is what makes deployments seamless.
