I’m working on a parse-server node backend application that is running with PM2 (process manager for node). I would like to know what is the best practice to achieve a graceful shutdown of the parse-server application because I don’t want to shut the app down in the middle of a query or any unfinished job.
I’d recommend to have a reverse proxy on top of parse server. You first set the proxy to stop forwarding requests to the parse server process. You wait the process to drain and then stop.
Hi @Rafarel I don’t have great expertise on apache but probably if you remove the proxypass and reload (not restart) apache, it will stop passing new requests, will still process the current ones, and will finally gracefully restart apache with the new settings. Then you can stop your parse server process.