Clustering Node JS in Heavy Traffic Production Environment

僤鯓⒐⒋嵵緔 提交于 2019-12-06 11:27:55

问题


I have a web service handling http requests to redirect to specific URLs. Right the CPU is hammered at about 5 million hits per day, but I need to scale it up to handle 20 million plus. This is a production environment so I am a little apprehensive about the new Node Cluster method b/c it is still listed as experimental. I need suggestions on how to cluster Node on handle the traffic on a linux server. Any thoughts?


回答1:


5 million per day is equivalent to 57.87 per second, and 25 million is 289.4 per second. These numbers are not too much for a single server for your case. If you only want to redirect specif urls, you can go with another alternatives such as nginx that is more fit for that job. However, if you still want to use NodeJS, I think a modern server can handle that load. Look at my blog post as an example of how to use clustering: NodeJS: Simple Clustering Benchmark. If you want to use all of your cores, you should use clustering.



来源:https://stackoverflow.com/questions/11023889/clustering-node-js-in-heavy-traffic-production-environment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!