如何提高NodeJS程序的运行的稳定性
2013-08-29 16:37
239 查看
如何提高NodeJS程序运行的稳定性
我们常通过node app.js方式运行nodejs程序,但总有一些异常或错误导致程序运行停止退出。如何保证node程序的稳定运行?
下面是一些可以考虑的方案:
1.使用最新的node版本程序。
2.使用try{...} catch(error){...}。
3.使用domains。
4.使用forever,upstart,monit,supervisor,mother.js等。
5.使用cluster。
6.使用 process.on('uncaughtException', function(err){...}); 来处理未被捕捉的错误。
参考:
http://shapeshed.com/uncaught-exceptions-in-node/ Uncaught Exceptions in Node.js
http://cnodejs.org/topic/4f16442ccae1f4aa270010e7 如何提高NodeJS程序的稳定性
http://deadhorse.me/nodejs/2013/04/13/exception_and_domain.html Node.js 异步异常的处理与domain模块解析
http://nodejs.org/api/process.html#process_event_uncaughtexception
http://nodejs.org/api/domain.html
https://github.com/fengmk2/domain-middleware
https://github.com/fengmk2/graceful
https://github.com/FGRibreau/forever-webui
我们常通过node app.js方式运行nodejs程序,但总有一些异常或错误导致程序运行停止退出。如何保证node程序的稳定运行?
下面是一些可以考虑的方案:
1.使用最新的node版本程序。
2.使用try{...} catch(error){...}。
3.使用domains。
4.使用forever,upstart,monit,supervisor,mother.js等。
5.使用cluster。
6.使用 process.on('uncaughtException', function(err){...}); 来处理未被捕捉的错误。
参考:
http://shapeshed.com/uncaught-exceptions-in-node/ Uncaught Exceptions in Node.js
http://cnodejs.org/topic/4f16442ccae1f4aa270010e7 如何提高NodeJS程序的稳定性
http://deadhorse.me/nodejs/2013/04/13/exception_and_domain.html Node.js 异步异常的处理与domain模块解析
http://nodejs.org/api/process.html#process_event_uncaughtexception
http://nodejs.org/api/domain.html
https://github.com/fengmk2/domain-middleware
https://github.com/fengmk2/graceful
https://github.com/FGRibreau/forever-webui
相关文章推荐
- 如何提高nodejs程序的稳定性,健壮性
- 如何提高nodejs程序的稳定性,健壮性
- 如何提高nodejs程序的稳定性(转)
- 如何提高NodeJS程序的稳定性
- 如何提高NodeJS程序的稳定性
- 如何提高NodeJS程序的稳定性
- 如何提高android程序运行效率,程序员在开发过程中应当注 意的一些事项
- 如何减少内存分配频率,提高程序运行效率
- 如何运行NodeJS程序
- 如何利用VS的代码优化和openmp并行计算提高程序运行速度
- 如何提高android程序运行效率,程序员在开发过程中应当注意的一些事项
- 再思考如何给Flex程序瘦身,如何提高swf运行性能
- 如何提高PHP程序运行效率 (转载)
- [C/C++]_[初级]_[如何编写简单有效代码,提高程序运行效率和性能]
- 提高程序运行效率的10个简单方法
- 如何让系统注销后,程序继续运行
- OS X中如何获取当前运行程序的路径
- Java程序员成长之路(如何提高Java程序性能?)
- 服务程序中如何以当前登陆用户身份运行程序
- mfc编写的程序如何在别人机器上运行?