流星的订阅和同步速度很慢 [英] Meteor's subscription and sync are slow

查看:69
本文介绍了流星的订阅和同步速度很慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含6000万只股票的1000万个文档的集合,股票名称已建立索引.当我订阅新股票时,流星会挂10秒钟以上,以获取约3000张该股票的文件.同样,在订购了几只股票之后,流星挂起并占用100%的CPU.流星同步大"收藏集看起来真的很慢.实际上我的应用程序只是只读的.我想知道是否有办法为只读客户端加速流星?我还想知道为每个股票创建单独的集合是否有帮助?

I have a collection with 10M documents of 6000 stocks, stock name is indexed. When I subscribe to a new stock, meteor hangs more than 10 seconds to get about 3000 documents of this stock. Also after several stocks are subscribed, meteor hangs with 100% cpu usage. Meteor looks really slow with syncing "big" collection. Actually my app just read only. I am wondering if there is way to speed up meteor for read-only client? I am also wondering if creating a separate collection for each stock helps?

推荐答案

这是一个规模问题,可能可以改进;应当注意,您为任务使用了错误的技术,因为Meteor是用于客户端之间的交互,而不是用于检索大量的只读时间敏感数据.虽然状态跟踪屏幕可能仍然有些意义,但大量时间紧迫的数据肯定没有...

While this is a scale issue and probably can be improved; it should be noted that you are using the wrong technology for your task, because Meteor is meant for interaction between clients and not for retrieving tons of read-only time sensitive data. While a status tracking screen might still somewhat make sense, time critical data in huge amounts certainly does not...

整个Meteor堆栈比任何本机堆栈中的简单实现都带来了极大的开销;老实说,我什至会考虑Java或C#会带来的开销,并且在那种语言与PHP和C ++等低级语言之间进行选择时要三思而后行.诸如Ruby,Python,Node.js之类的语言确实是另一回事.它们是为快速原型制造的,但是就延迟/吞吐量而言,它们由于JIT的开销而落后,不要忘了开销会增加一些非本地的做事方法.

The whole Meteor stack introduces an extreme overhead over a simple implementation in any native stack; honestly, I would even take into account the overheads Java or C# would introduce and think twice when choosing between that and low level languages like PHP and C++. Languages like Ruby, Python, Node.js and more are really a different story; they're made for rapid prototyping but in terms of latency / throughput they are behind due to the overhead it takes to JIT them, not to forget at the overhead some non-native approaches to doing things add.

TL; DR :使用正确的工具完成工作,否则您会割伤手指...

这篇关于流星的订阅和同步速度很慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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