简体   繁体   English

ArangoDb集群查询性能问题

[英]ArangoDb cluster query performance issue

I setup simple cluster with 2 Db servers and 2 Coordinators. 我用2个Db服务器和2个协调器设置了简单集群。 When I'm performing a simple select query I see significant performance degradation even with minimum data versus single machine setup. 当我执行一个简单的选择查询时,即使使用最少的数据与单机设置相比,我也会看到性能显着下降。

FOR key IN @keys 
FOR user IN User FILTER user.UserId == key 
RETURN user

I have hash index setup for UserId. 我为UserId设置了哈希索引。 Even with 100 Users in collection and @keys containing 2 keys this query takes ~300ms vs ~4ms on single machine configuration. 即使集合中有100个用户并且@keys包含2个密钥,此查询也需要约300ms的时间,而在单机配置中为@keys

Users collection has 4 shards setup by _key . Users集合通过_key设置了4个分片。

Clustering involves more network connections and thus more network latencies. 群集涉及更多的网络连接,因此涉及更多的网络延迟。 Data has to be de/serialized (which involves parsing etc.). 数据必须反序列化(包括解析等)。 Shards etc. have to be managed in a centralized manner. 碎片等必须集中管理。

Depending on your query, (ie a sub query that leans on the sorted result of its bearer) parts of the query have to be distributed across the cluster with several round trips involving even more communication. 根据您的查询(即依赖于其承载的排序结果的子查询),查询的部分必须通过涉及更多通信的几次往返过程在整个群集中分布。

Clustering is intended to give you rather a higher throughput and access to more computing resources and not the low latency a single server environment can provide. 群集旨在为您提供更高的吞吐量和对更多计算资源的访问,而不是单个服务器环境可以提供的低延迟。

As long as a single machine can scale to your workload, clustering simply isn't the proper solution. 只要一台机器可以扩展到您的工作量,群集根本不是合适的解决方案。 This will change with our upcoming 3.0 version, in which the new synchronous replication gives you fault tolerance and high availability in addition to scalability. 这将在我们即将推出的3.0版本中发生变化,在该版本中,新的同步复制不仅具有可伸缩性,还具有容错能力和高可用性。 Currently you can distribute query load to several machines using replication . 当前,您可以使用复制将查询负载分配到多台计算机。

Read more about ArangoDB Cluster performance in Max Blog article which scales to a big environment whilst keeping the latency reasonably low. 在Max Blog文章中阅读有关ArangoDB群集性能的更多信息,该文章可扩展到一个大型环境,同时将延迟保持在较低水平。

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

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