Advertising

Summary: Slow event listener's work
Key: IGNITE-7662
URL: https://issues.apache.org/jira/browse/IGNITE-7662
Project: Ignite
Issue Type: Wish
Components: cache
Affects Versions: 2.2
Reporter: Ruslan Gilemzyanov
I wroted some code that can run Ignite server node and attached to it
EventListener. Then I putted 10 elements on the cache, and for each element
recorded a time difference between putting and catching.
*When I created one server node and put 10 elements in IgniteCache I've got
good results. For 10 elements it was:*
ruslangm.sample.ignite.listener.EventListener - Time diff between put and
listener - 51 ruslangm.sample.ignite.listener.EventListener - Time diff between
put and listener - 2 ruslangm.sample.ignite.listener.EventListener - Time diff
between put and listener - 1 ruslangm.sample.ignite.listener.EventListener -
Time diff between put and listener - 1
ruslangm.sample.ignite.listener.EventListener - Time diff between put and
listener - 1 ruslangm.sample.ignite.listener.EventListener - Time diff between
put and listener - 2 ruslangm.sample.ignite.listener.EventListener - Time diff
between put and listener - 2 ruslangm.sample.ignite.listener.EventListener -
Time diff between put and listener - 2
ruslangm.sample.ignite.listener.EventListener - Time diff between put and
listener - 2 ruslangm.sample.ignite.listener.EventListener - Time diff between
put and listener - 1
*The results were the same when I added one node* (Topology snapshot became:
[ver=2, servers=2, clients=0, CPUs=4, heap=3.6GB]).
*But when i applied setBackups(1) to IgniteCache the results became weird:*
ruslangm.sample.ignite.listener.EventListener - Time diff between put and
listener - 573 ruslangm.sample.ignite.listener.EventListener - Time diff
between put and listener - 573 ruslangm.sample.ignite.listener.EventListener -
Time diff between put and listener - 570
ruslangm.sample.ignite.listener.EventListener - Time diff between put and
listener - 571 ruslangm.sample.ignite.listener.EventListener - Time diff
between put and listener - 571 ruslangm.sample.ignite.listener.EventListener -
Time diff between put and listener - 571
ruslangm.sample.ignite.listener.EventListener - Time diff between put and
listener - 571 ruslangm.sample.ignite.listener.EventListener - Time diff
between put and listener - 561 ruslangm.sample.ignite.listener.EventListener -
Time diff between put and listener - 560
*My code for creating an IgniteCache and attaching to it event listener is very
simple:*
{{Ignite ignite = Ignition.start("ignite.xml")) CacheConfiguration<String,
Long> cfg = new CacheConfiguration<>();
cfg.setCacheMode(CacheMode.PARTITIONED);
cfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
cfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_ASYNC);
cfg.setName("myCache"); cfg.setBackups(1); IgniteCache<String, Long> cache =
ignite.getOrCreateCache(cfg); ContinuousQuery<String, Long> query = new
ContinuousQuery<>(); query.setLocalListener(new EventListener());
query.setLocal(true); QueryCursor<Cache.Entry<String, Long>> cursor =
cache.query(query);}}
In my listener I just print this message:
{{ruslangm.sample.ignite.listener.EventListener - Time diff between put and
listener }}
You can look at it on [github|https://github.com/ruslangm/ignite-sample], it is
really so simple.
Is Ignite is really so slow in listening events when there are exist backups?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)