Graceful shutdown means when all your requests to the server is respond and not any data processing work left. database connections) and not take any other requests and after that, you can shut down your server with a quiet conscience. Imagine you need to shut down the server, the easiest way to do that is +C and the server will be killed, but wait, what if your server did not finish all the requests, what if some client connections are closed because the server is killed and can not handle the requests.Īs you might guess you need to handle all requests and close all resources which are processing on data(e.e. Let’s imagine you have an HTTP server with NodeJS which connected to a database, and every time server gets called then it sends a request to the database to get/set a data which also will send to the client by the response. In this article, I am going to show you how to do a graceful shutdown in NodeJS application, but first, let's describe what does “graceful shutdown” means and why we need to do that in our application and what are the benefits.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |