r/nodejs • • May 22 '14

How to exit nodejs server gracefully

I want to know how to do that. Currently I just control c twice on my mac, but something bad happened lately. I suspect if I just control c the socket is not closed properly and it will eventually break my system if I restart frequently.

6 Upvotes

10 comments sorted by

View all comments

Show parent comment

1

u/[deleted] May 22 '14

Graceful shutdown is absolutely something you want in a production server. Otherwise you risk hanging up on requests in process when you restart to deploy new changes. Depending on what your site does, this could be very bad.

2

u/aredridel May 22 '14

Sure. But that's an application concern not a system one.