Node.js reliability for large application

前端 未结 4 529
-上瘾入骨i
-上瘾入骨i 2021-01-31 02:57

I am new to Node.js and am currently questioning its reliability.

Based on what I\'ve seen so far, there seems to be a major flaw: any uncaught error/exceptions crashes

4条回答
  •  感动是毒
    2021-01-31 03:29

    For automatic restarts and load-balancing, I'd suggest you check out Learnboost's up balancer.

    It allows you to reload a worker behind the load-balancer without dropping any requests. It stops directing new requests towards the worker, but for existing requests that are already being served, it provides workerTimeout grace period to wait for requests to finish before truly shutting down the process.

    You might adapt this strategy to be also triggered by the uncaughtException event.

提交回复
热议问题