gpt4 book ai didi

java - 将数据放入分布式 map 时,Hazelcast 很慢

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:32:00 25 4
gpt4 key购买 nike

我有两个 hazelcast 节点(16GB 内存,每个节点 4 个核心)。当我尝试将其放入分布式 map 时,hazelcast 非常慢(1904 puts/s)但是如果我关闭一个节点,性能会提高(30000 puts/秒)。任何人都可以帮助我提高多节点的性能吗?谢谢

最佳答案

请检查您的配置。您必须有同步备份,因为当数据被复制到另一个节点时,您的 put 查询就完成了。这是默认配置。

You can use asynchronous backup to improve performance. But this will hamper the consistency of the system.


关于一致性的更多信息:

在 CAP 定理的上下文中,Hazelcast 是一个 AP 产品。因此,Best-Effort Consistency 的目标是复制,syncasync 备份都是惰性复制模型。正如页面中所解释的那样;两个选项的区别是;

  • 同步备份,调用者阻塞,直到备份副本应用备份更新并且确认被发送回调用者
  • 异步备份 以即发即忘的方式工作。下面,请看来自Hazelcast Reference Manual的部分:

Hazelcast's replication technique enables Hazelcast clusters to offer high throughput. However, due to temporary situations in the system, such as network interruption, backup replicas can miss some updates and diverge from the primary. Backup replicas can also hit long GC pauses or VM pauses, and fall behind the primary, which is a situation called as replication lag. If a Hazelcast partition primary replica member crashes while there is a replication lag between itself and the backups, strong consistency of the data can be lost.

关于java - 将数据放入分布式 map 时,Hazelcast 很慢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52944510/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com