I am using Nodemon with Forever Module on Ubuntu Server.
I use this command to start my Node Server:
forever start -c nodemon app.js --exitcrash
It works fine for few hours (approx 48 Hours), but after that my Server stops working with these errors:
Error: getaddrinfo EMFILE
TypeError: Cannot call method 'indexOf' of undefined
Error: Handshake inactivity timeout
These errors are caused due to Exceeding Limit of Open Files/Sockets.
Now my question is:
Can I use -m (Which sets to unlimited in my Operating System):
max memnory size (kbytes, -m) unlimited
Should I use the above command with -m? Are there any drawbacks?
Or is there any other efficient solution to fix Server crashing?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…