简体   繁体   English

AWS上的FIWARE Orion / MongoDB性能

[英]FIWARE Orion/MongoDB Performance on AWS

I seem to be having real issues trying to get performance anywhere near that stated in the docs (~700 - 2000 tps with a VM of: 2 vCPUs 4GB RAM). 我似乎在尝试获得接近文档所述性能的任何地方都遇到了实际问题(〜700-2000 tps,VM为:2个vCPU 4GB RAM)。 I have tried on a local VM, a local machine and a few AWS VMs and I can't get anywhere close. 我在本地VM,本地计算机和一些AWS VM上进行了尝试,但无法找到任何地方。 - The maximum I have achieved is 80 tps on an AWS VM. -在AWS VM上,我实现的最高速度为80 tps。

I have tried changing the -dbPoolSize and the -reqPoolSize for orion and playing with ulimit to set it to that suggested by MongoDB - but everything I change doesn't seem to get me anywhere close. 我试过为orion更改-dbPoolSize和-reqPoolSize并使用ulimit将其设置为MongoDB建议的值-但我更改的所有内容似乎都无法解决我的问题。

I have set indexes on the _id.id, _id.type and _id.servicePath as suggested in the docs - the latter of which gave me an increase from 40 tps to 80 tps. 我已经按照文档中的建议在_id.id,_id.type和_id.servicePath上设置了索引-后者使我从40 tps增加到80 tps。

Are there any config options for Orion or Mongo that I should be setting away from the default which will get me any closer? 我应该将Orion或Mongo的配置选项与默认设置区分开吗,这会使我更接近? Are there any other tips for performance? 还有其他表现技巧吗? The link in the docs to the test scripts doesn't work so I haven't been able to see the examples. 文档中指向测试脚本的链接无效,因此我无法查看示例。

I have created my own test scripts using Node.js and I have tested update and queries using a variable amount of concurrent connections and between 1 and 2 load injectors. 我使用Node.js创建了自己的测试脚本,并且使用可变数量的并发连接以及1到2个负载注入器测试了更新和查询。

From looking at the output from "top" the load is with Mongo as it almost maxes out the CPU but adding more cores to the VM doesn't change the stats. 从“顶部”的输出看,Mongo负载很大,因为它几乎使CPU耗尽,但向VM添加更多内核不会改变统计信息。 The VM has 7.5GB or 15GB of RAM so mongo should be able to put all the data into memory for blazing fast performance? VM拥有7.5GB或15GB的RAM,因此mongo应该能够将所有数据放入内存中以实现出色的性能吗?

I have used mongostat to see that the connections from orion to mongo change with the -dbPoolSize option, but this doesn't yield any better performance. 我已经使用mongostat来查看从Orion到mongo的连接是否已使用-dbPoolSize选项进行了更改,但这并不会产生任何更好的性能。

Any help you can provide would be much appreciated. 您能提供的任何帮助将不胜感激。

I have tried using CentOS 6.5 and 6.7 with Orion 0.25 and 0.26 and MongoDB 2.6 with ~500,000 entities 我尝试将CentOS 6.5和6.7与Orion 0.25和0.26以及MongoDB 2.6一起使用,具有约500,000个实体

My test scripts and data are on GitHub 我的测试脚本和数据在GitHub上

I have only tested without subscriptions so far, but I have scripts ready to test with subscriptions - but I wanted to get a good baseline before adding subscriptions. 到目前为止,我只进行了没有订阅的测试,但是我已经准备好可以对订阅进行测试的脚本-但是我想在添加订阅之前获得一个良好的基准。

My data is modeled around parking spaces in the UK countries their regions and their outcodes (first part of the postcode). 我的数据围绕英国国家/地区的停车位及其邮政编码(邮政编码的第一部分)建模。 This is using servicePaths to split them down to parking lot in an outcode. 这是使用servicePaths将它们按输出代码分成停车场。

Here is a gist with the requests and mongo shell output 这是请求和mongo shell输出要点

Performance is a complex topic which depends on many factor (deployment setup of Orion and MongoDB, startup configuration of Orion and MongoDB, hardware profile in the systems hosting the processes, network communications, overprovisioning level in the case of virtualization, injected load, etc.) so there isn't any general answer to deal with this kind of problems. 性能是一个复杂的主题,取决于许多因素(Orion和MongoDB的部署设置,Orion和MongoDB的启动配置,托管进程的系统中的硬件配置文件,网络通信,虚拟化情况下的超额配置级别,注入的负载等)。 ),因此没有任何通用的答案可以解决此类问题。 However, I'd try to provide some hints and recommendations that I hope may help. 但是,我会尝试提供一些提示和建议,希望对您有所帮助。

Regarding versions, Orion 0.26.0 (or 0.26.1) is recommended over 0.25.0. 对于版本,建议Orion 0.26.0(或0.26.1)超过0.25.0。 We have included a lot of improvements related with performance in Orion 0.26.0. 我们在Orion 0.26.0中包含了许多与性能相关的改进 Regarding MongoDB, we have also found that 3.0 could be much better than 2.6 , specially in update intensive scenarios. 关于MongoDB,我们还发现3.0可能比2.6更好 ,特别是在更新密集型方案中。

Having said that, first of all you should locate the bottleneck. 话虽如此,首先您应该找到瓶颈。 Useful tools to do this are top , mongostat and mongotop . topmongostatmongotop是实现此目的的有用工具。 It could be either Orion, MongoDB or the network connecting them. 可能是Orion,MongoDB或连接它们的网络。 If the bottleneck is CB, maybe the performance tuning hints provided in this document may help . 如果瓶颈是CB,则本文档中提供的性能调整提示可能会有所帮助 Slow queries information in MongoDB could be also pointing to bottlenecks at Orion. MongoDB中缓慢的查询信息也可能指向Orion的瓶颈。 If the bottleneck is MongoDB, taking into account the large number of entities you have (500,000) maybe you should consider to implement sharding . 如果瓶颈是MongoDB,考虑到您拥有的大量实体(500,000),也许您应该考虑实施分片 If the bottleneck is the network, colocation both Orion and MongoDB may help. 如果瓶颈是网络,则同时托管Orion和MongoDB可能会有所帮助。

Finally, some things you can also try in order to get more insight into the problem: 最后,您还可以尝试一些操作以更深入地了解问题:

  • Run some tests outside AWS (ie virtual machines in local premises) to compare. 在AWS外部(即本地场所中的虚拟机)运行一些测试以进行比较。 I don't know too much about the overprovising policy in AWS but based in my previous experiences with other cloud providers the VM overprovisioning (specially if it varies along time) could impact in performance. 我对AWS中的过度验证策略了解不多,但是根据我以前与其他云提供商的经验,VM过度配置(尤其是随时间变化的虚拟机)可能会影响性能。
  • Analyze if the peformance is related with the number of entities. 分析性能是否与实体数量有关。 Eg run test with 500, 5,000, 50,000 and 500,000 entities and get the performance figure in each case. 例如,对500、5,000、50,000和500,000个实体进行测试,并获得每种情况下的性能指标。
  • Analyze if the performance is related with the usage of servicePath, eg put all the 500,000 entities in the default service path / (moving the current content of the servicePath to another place, eg an entity attribute or part of the entity ID string) and test. 分析性能是否与servicePath的使用有关,例如,将所有500,000个实体放在默认服务路径中/ (将servicePath的当前内容移动到另一个位置,例如,实体属性或实体ID字符串的一部分)并进行测试。 Currently Orion uses a regex to filter for servicePath and that could be slow. 当前,Orion使用正则表达式过滤servicePath,这可能很慢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM