javascript 在 Meteor.js 中构建的 Web 应用程序可以处理多少并发用户?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18083835/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How many concurrent users can a web app built in Meteor.js handle?
提问by francesco
We are building a web app which will be used during a contest to vote contestants and display real-time vote statistics on a central display.
我们正在构建一个网络应用程序,它将在比赛期间用于为参赛者投票并在中央显示器上显示实时投票统计数据。
The contest will last 15 minutes and around 4000 users will be connecting to the web app in that lapse of time and send votes, which however are unique per user device.
比赛将持续 15 分钟,大约 4000 名用户将在这段时间内连接到网络应用程序并发送投票,但每个用户设备都是独一无二的。
We are thinking to develop such web app using Meteor.js. However, due to our little experience in developing services for such big amount of concurrent users and the beta state of Meteor.js, we have some concerns regarding the actual feasibility of the project.
我们正在考虑使用 Meteor.js 开发这样的 Web 应用程序。但是,由于我们在为如此多的并发用户开发服务方面经验很少,并且 Meteor.js 处于 Beta 状态,因此我们对该项目的实际可行性有一些担忧。
The following are the questions we are addressing:
以下是我们正在解决的问题:
- Is there any benchmark on how many concurrent users Meteor can handle? I assume this depends on the complexity of the web app itself. In our case it would be rather straight forward, only the client used for the central display will be subscribed to the live Mongo query
votes.find({})
, the rest of the users will only see the vote/ already votedbutton.
- 有没有关于 Meteor 可以处理多少并发用户的基准?我认为这取决于网络应用程序本身的复杂性。在我们的例子中,这将是相当直接的,只有用于中央显示的客户端才会订阅实时 Mongo 查询
votes.find({})
,其余用户只会看到vote/already voted按钮。
Having some data from a real case or test scenario would help us a lot.
从真实案例或测试场景中获得一些数据会对我们有很大帮助。
Would Meteor's infrastructure be able to handle 4000 users? Or should we go for some other hosting solution as listed in this deleted question(you need 10k+ rep to see it)?
Are there any performance considerations specific to Meteor.js we should be aware of?
Meteor 的基础设施能否处理 4000 个用户?或者我们应该选择这个已删除问题中列出的其他托管解决方案(您需要 10k+ 代表才能看到它)?
是否有任何我们应该注意的特定于 Meteor.js 的性能注意事项?
We have seen already similar posts, however none of them was dealing with such large amount of users in such a short time:
我们已经看到过类似的帖子,但是他们都没有在这么短的时间内处理过如此多的用户:
- How much load can meteor's servers handle?(2013)
- How efficient can Meteor be while sharing a huge collection among many clients?
Also, we could use the Cluster smart package. Anyone has any experience with this?
此外,我们可以使用集群智能包。任何人都有这方面的经验?
回答by Dan Dascalescu
UPDATEClassCraft reports one Meteor server handling 6400 concurrent users. Read more in the Scalability section of my Why Meteor article.
UPDATEClassCraft 报告了一台处理 6400 个并发用户的 Meteor 服务器。在我的Why Meteor 文章的可扩展性部分阅读更多内容。
See also the forum post
How Many Simultaneous Users Does the Biggest Current Meteor App Support?
另请参阅论坛帖子
当前最大的 Meteor 应用程序支持多少个同时使用的用户?
Here's a benchmark not exactly about concurrent users, but rather about setting up subscriptions (arguably a more stressful test).
这是一个不完全关于并发用户的基准,而是关于设置订阅(可以说是一个压力更大的测试)。
Arunoda has recently published the results of a test using meteor-down
(a load testing tool similar to @alanning's meteor-load-test) and Cluster, a Meteor load balancing tool.
Arunoda 最近发布了使用meteor-down
(类似于@alanning 的meteor-load-test的负载测试工具)和流星负载平衡工具Cluster的测试结果。
The test was run on the cheapest Digital Ocean servers (512MB RAM, $5/month), and the results were rather impressive:
该测试在最便宜的 Digital Ocean 服务器(512MB RAM,5 美元/月)上运行,结果相当令人印象深刻:
For all the above scenarios, server response time is less than 8ms.
对于上述所有场景,服务器响应时间都小于 8ms。
Essentially one commodity machine can handle 2500 Meteor subscriptions per minute and respond within 8 miliseconds. Horizontal scaling takes less than 5% overhead.
基本上,一台商品机器每分钟可以处理 2500 个 Meteor 订阅,并在 8 毫秒内做出响应。水平扩展的开销不到 5%。
You can read more about the test at Meteor Cluster Performance Test: Impressive Results.
您可以在Meteor Cluster Performance Test: Impressive Results 中阅读有关该测试的更多信息。
回答by Andy Eskridge
https://github.com/alanning/meteor-load-test
https://github.com/alanning/meteor-load-test
If you mock up the app quickly, it should be fairly straightforward to set up a test for 4000 connections over a 15 minute period. I haven't used it personally but plan to do so once I finish fleshing out my own application.
如果您快速模拟应用程序,在 15 分钟内设置 4000 个连接的测试应该相当简单。我个人没有使用过它,但计划在我充实自己的应用程序后使用它。
回答by robjohncox
I think the honest answer is that every case is different, and there are no hard and fast rules that people can give you in terms of how your system will perform under different loads.
我认为诚实的答案是,每个案例都不同,人们可以就您的系统在不同负载下的性能方面给您提供没有硬性规定。
Your best bet is to actually build a simple prototype of your system, with one or two functions, and then look to run some performance testing using multiple concurrent users to determine what the limitations are. This should give you a good basis to then iterate on your prototype and work out if/how you can support the number of users you require.
最好的办法是实际构建一个简单的系统原型,具有一两个功能,然后使用多个并发用户运行一些性能测试,以确定有哪些限制。这应该为您提供一个良好的基础,然后迭代您的原型并确定您是否/如何支持您需要的用户数量。