3 ms·
I think in the case of web servers (that are most times stateless), guaranteeing it will survive a "kill -9" just means having some sort of supervisor service.
by nemothekid 11y ago
I think in the case of web servers (that are most times stateless), guaranteeing it will survive a "kill -9" just means having some sort of supervisor service.
However there are times you want a graceful restart because an abrupt restart affects your client's UX - such as during a file upload, or where a client may be running a long running synchronous operation (like a credit card charge). In both cases the system may be resilient against a -9 and retries, but annoying if "the world stops" because of a change to prod.
- AYBABTME 11y agoA supervisor service boils down to the same issue if there's a network partition or if the machine just blows up, a disk fails, the kernel panics, the power supply dies, etc. The thing is you can't guarantee that any process will survive all a request, so you might as well work as if you were living in Hell and every request has a 0.5 probability of failing (by any mean).
- nemothekid 11y agoRight, which are cases where a graceful restart will never help you. If a user is uploading a 4K video file and the server dies because god said so, well they can just try again. If the server dies because the dev team decides to push to prod 4x in an hour and the user has to retry every time, a graceful restart lets you do that without pissing off anyone who was using that live connection.
- AYBABTME 11y agoAgreed, that's what I meant in: I think graceful restarts are fine for servers that offer web pages or other things where a client will not retry a request. + when retrying a request is not practical.