-
1. Re: Infinispan write latency is high
rvansa Jan 8, 2015 12:02 PM (in response to sanpingz)If you're using multi-node cluster, this can be expected. Reads are served directly from the server you contact via HotRod, while the write has to be replicated on the backup nodes. Also, with concurrent access, locks are used and that can limit the latency.
-
2. Re: Infinispan write latency is high
sanpingz Jan 13, 2015 7:28 AM (in response to rvansa)Thanks Radim, it's reasonable that write will take longer time than read, which is the sync case.
I also tested async distribution mode to improve write latency. As expected, write latency is improved, but the read latency got worse than sync mode, I suppose async just works for write, why read latency get high? Does Infinispan read all replicas for consistency consideration in async mode?
-
3. Re: Infinispan write latency is high
rvansa Jan 13, 2015 10:41 AM (in response to sanpingz)No, reads behave in the same way with both sync and async replication. If the reads are slower (how much, btw.?), it's because the cluster usage (threads occupation, context switching...) changed in some way- maybe you execute more writes in your test, so the cluster is more busy and handling reads takes longer. Check your CPU, memory and GC stats as well.
-
4. Re: Infinispan write latency is high
nadirx Jan 13, 2015 11:18 AM (in response to sanpingz)Does Infinispan read all replicas for consistency consideration in async mode?
Infinispan is strongly consistent, so it doesn't have to do that. Only the primary owner is queried for the data.
-
5. Re: Infinispan write latency is high
sanpingz Jan 14, 2015 10:23 AM (in response to rvansa)Thanks Radim, finally I found it was caused by some network issues.
In addition, if my understanding is right, async distribution mode means async replication from contact node to other nodes, right?
-
6. Re: Infinispan write latency is high
sanpingz Jan 14, 2015 11:45 AM (in response to nadirx)From user guide, it said read request will be sent to all data owners in parallel and first returning result is used. As my understanding, all the owners have chance to serve query, is my understanding right? So it is possible to cause data inconsistent in async mode?
-
7. Re: Infinispan write latency is high
rvansa Jan 14, 2015 1:18 PM (in response to sanpingz)With async replication, it is possible that after you call cache.put(k, v2), cache.get(k) will return v1. Eventually, all owners will contain the same value and updates will occur in the same order, but you don't know when.