在交通繁忙的生产环境中集群节点JS [英] Clustering Node JS in Heavy Traffic Production Environment

查看:115
本文介绍了在交通繁忙的生产环境中集群节点JS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Web服务处理http请求以重定向到特定的URL。对,CPU每天大约有500万次点击,但我需要将其扩展到2000万以上。这是一个生产环境,所以我对新的Node Cluster方法有点担心b / c它仍然被列为实验性的。我需要有关如何集群Node来处理linux服务器上的流量的建议。有什么想法吗?

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?

推荐答案

每天500万相当于每秒57.87,而2500万每秒289.4。对于您的案例,这些数字对于单个服务器来说并不算太多。如果您只想重定向指定网址,可以使用其他替代方法,例如更适合的 nginx 工作。但是,如果您仍想使用NodeJS,我认为现代服务器可以处理该负载。请查看我的博客文章,了解如何使用群集: NodeJS:简单群集基准。如果要使用所有核心,则应使用群集。

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.

这篇关于在交通繁忙的生产环境中集群节点JS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆