[ 
https://issues.apache.org/jira/browse/IGNITE-7662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ruslan Gilemzyanov updated IGNITE-7662:
---------------------------------------
    Description: 
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:*

EventListener - diff between put and listener - 51

EventListener - diff between put and listener - 2

EventListener - Time diff between put and listener - 1

EventListener - Time diff between put and listener - 1

EventListener - Time diff between put and listener - 1

EventListener - Time diff between put and listener - 2

EventListener - Time diff between put and listener - 2

EventListener - Time diff between put and listener - 2

EventListener - Time diff between put and listener - 2

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:*

EventListener - Time diff between put and listener - 573

EventListener - Time diff between put and listener - 573

EventListener - Time diff between put and listener - 570

EventListener - Time diff between put and listener - 571

EventListener - Time diff between put and listener - 571

EventListener - Time diff between put and listener - 571

EventListener - Time diff between put and listener - 571

EventListener - Time diff between put and listener - 561

EventListener - Time diff between put and listener - 560

*My code for creating an IgniteCache and attaching to it event listener is very 
simple:*
{code:java}
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);
{code}
In my listener I just print this message:

EventListener - 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 really so slow in listening events when there are exist backups?

  was:
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:*

EventListener - diff between put and listener - 51

EventListener - diff between put and listener - 2

EventListener - Time diff between put and listener - 1

EventListener - Time diff between put and listener - 1

EventListener - Time diff between put and listener - 1

EventListener - Time diff between put and listener - 2

EventListener - Time diff between put and listener - 2

EventListener - Time diff between put and listener - 2

EventListener - Time diff between put and listener - 2

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:*

EventListener - Time diff between put and listener - 573

EventListener - Time diff between put and listener - 573

EventListener - Time diff between put and listener - 570

EventListener - Time diff between put and listener - 571

EventListener - Time diff between put and listener - 571

EventListener - Time diff between put and listener - 571

EventListener - Time diff between put and listener - 571

EventListener - Time diff between put and listener - 561

EventListener - Time diff between put and listener - 560

*My code for creating an IgniteCache and attaching to it event listener is very 
simple:*
{code:java}
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);
{code}
In my listener I just print this message:

EventListener - 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?


> 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
>            Priority: Minor
>
> 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:*
> EventListener - diff between put and listener - 51
> EventListener - diff between put and listener - 2
> EventListener - Time diff between put and listener - 1
> EventListener - Time diff between put and listener - 1
> EventListener - Time diff between put and listener - 1
> EventListener - Time diff between put and listener - 2
> EventListener - Time diff between put and listener - 2
> EventListener - Time diff between put and listener - 2
> EventListener - Time diff between put and listener - 2
> 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:*
> EventListener - Time diff between put and listener - 573
> EventListener - Time diff between put and listener - 573
> EventListener - Time diff between put and listener - 570
> EventListener - Time diff between put and listener - 571
> EventListener - Time diff between put and listener - 571
> EventListener - Time diff between put and listener - 571
> EventListener - Time diff between put and listener - 571
> EventListener - Time diff between put and listener - 561
> EventListener - Time diff between put and listener - 560
> *My code for creating an IgniteCache and attaching to it event listener is 
> very simple:*
> {code:java}
> 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);
> {code}
> In my listener I just print this message:
> EventListener - 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 really so slow in listening events when there are exist backups?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to