我有两个hazelcast节点(16GB RAM,每个节点4个核心)。当我尝试将其放置到分布式地图时,hazelcast速度非常慢(1904 puts / s),但是如果我关闭一个节点,性能将会提高(30000 puts / s)。任何人都可以帮助我提高多节点性能吗?谢谢
答案 0 :(得分:3)
请检查您拥有的配置。您必须具有同步备份,这样当数据复制到另一个节点时,您的放置查询就完成了。这是默认配置。
您可以使用异步备份来提高性能。但这会妨碍系统的一致性。
有关一致性的更多信息:
在CAP定理的上下文中, Hazelcast 是 AP 产品。因此,尽力而为的一致性是针对复制的,而 sync 和 async 备份都是惰性复制模型。如页面中所述;两种选择之间的区别是;
Hazelcast的复制技术使Hazelcast群集能够提供高吞吐量。但是,由于系统中的临时情况(例如网络中断),备份副本可能会丢失某些更新并与主副本有所不同。备份副本还可能会导致长时间的GC暂停或VM暂停,并落后于主副本,这种情况称为复制滞后。如果Hazelcast分区主副本成员在其自身与备份之间存在复制滞后时崩溃,则可能会丢失数据的强一致性。
答案 1 :(得分:0)
我运行嵌入实例,使用数据可序列化,键是String [25chars],值是Object {String [25chars],String [25 chars]}
<in-memory-format>OBJECT</in-memory-format>
<backup-count>0</backup-count>
<async-backup-count>1</async-backup-count>
<!--
Maximum number of seconds for each entry to stay in the map. Entries that are
older than <time-to-live-seconds> and not updated for <time-to-live-seconds>
will getMSISDN automatically evicted from the map.
Any integer between 0 and Integer.MAX_VALUE. 0 means infinite. Default is 0
-->
<time-to-live-seconds>864000</time-to-live-seconds>
<!--
Maximum number of seconds for each entry to stay idle in the map. Entries that are
idle(not touched) for more than <max-idle-seconds> will getMSISDN
automatically evicted from the map. Entry is touched if getMSISDN, putMSISDN or containsKey is called.
Any integer between 0 and Integer.MAX_VALUE. 0 means infinite. Default is 0.
-->
<max-idle-seconds>864000</max-idle-seconds>
<!--
Valid values are:
NONE (no eviction),
LRU (Least Recently Used),
LFU (Least Frequently Used).
NONE is the default.
-->
<eviction-policy>LRU</eviction-policy>
<near-cache>
<max-size>0</max-size>
<time-to-live-seconds>864000</time-to-live-seconds>
<max-idle-seconds>864000</max-idle-seconds>
<eviction-policy>LRU</eviction-policy>
<invalidate-on-change>true</invalidate-on-change>
<in-memory-format>BINARY</in-memory-format>
<cache-local-entries>false</cache-local-entries>
<eviction size="1000" max-size-policy="ENTRY_COUNT" eviction-policy="LFU"/>
</near-cache>
</map>
答案 2 :(得分:0)
我使用putAll并将内存格式设置为BINARY,TPS的速度为30K / s。但是我不能在没有调用mapstore的情况下使用putAll。