Reputation: 3282
We are using Hazelcast in our project. We have a multi-node setup in which Hazelcast is running in all the three nodes (Hazelcast cluster). There is a latency delay in multi-node setup due to WAN latency (i.e) three nodes are in different locations.
If I ping from one node (say n1) to the other node (say n2), there is a consistent delay say 100ms.
But I am directly hitting to the one of the node (say like n1) from our web application, what we see is that there is a delay in the Hazelcast cast processing.
I am confused on the how Hazelcast works in a multi-node setup. Even if I hit directly to one of the nodes in the multi-node setup, why is there a delay in it?
I need the following information,
1) How does Hazelcast work in a multi-node cluster, and why there is a delay when I call any one of the nodes?
2) If so, how to do the tuning to avoid the delay?
3) Does Hazelcast contact to another node in case of get call?
Upvotes: 0
Views: 1136
Reputation: 1
Hazelcast uses distributed caching. that means your data will be stored in one of the members. if the data is not in the local member, hazelcast needs to access the data from another member. this will cause a delay if that member is in a different region. (This is not a delay of a hazelcast. It's a network delay).
How does Hazelcast work in a multi-node cluster, and why there is a delay when I call any one of the nodes?
there should not be a delay when you ping the local member.
the delay can be there when you write to a local member and you have configured synchronous backup to another member.
the delay can be there when getting the data. if the data is not in local member.
If so, how to do the tuning to avoid the delay?
it depends on the read-write ratio. if the no of writes is few. you can allow from back up. there are limitations to this as well check the documentation
Does Hazelcast contact to another node in case of get call?
yes it will contact another member if the data is stored in another member
Upvotes: 0
Reputation: 6104
Hazelcast partitions data, therefore each node holds a subset of the overall dataset. If you try to retrieve an element which is not hold locally (owned by the local node), you have to get it from a remote node. 100ms sounds like a pretty bad WAN connection and Hazelcast clusters are not designed to work over WAN.
Upvotes: 1