2

I am using Webrtc, nodejs, Expressjs as the framework to create a audio, video and chat application. I have used Forever so that the script runs continuously.

As my application deals with audio, video and chat. User presence plays an important role. We need to have the system up and running always and avoid system crashes and restart. If it happens we are going to loose all information regarding the users who were online. Need Suggestions what are the best approaches to avoid such situations.

Also, while moving new features to the production server, what steps should we take into consideration so that the application doesn't stop and henceforth we don't loose user information.

What if the server went down or we had to make it down. What are the different techniques that can be used so that we don't loose the presence information of the online users in the system and restore them back(if necessary).

4

1 回答 1

0

1)使用节点集群为每个核心分叉多个进程。因此,如果一个进程死亡,另一个进程将自动启动。查看:http ://nodejs.org/api/cluster.html

2)使用域来捕获异步操作,而不是使用 try-catch 或未捕获的http://nodejs.org/api/domain.html。我并不是说尝试捕获或未捕获是不好的想法!

3)使用forever/supervisor来监控你的服务

4)添加守护进程来运行你的节点应用程序:http ://upstart.ubuntu.com

希望这可以帮助!

我也在这篇文章中回答:如何防止 node.js 崩溃?尝试捕捉不起作用

于 2013-08-29T06:26:16.417 回答