IgniteCache.destroy() taking long time

classic Classic list List threaded Threaded
5 messages Options
Shravya Nethula Shravya Nethula
Reply | Threaded
Open this post in threaded view
|

IgniteCache.destroy() taking long time

This post was updated on .
Hi,

I have created a cache using the following API:
IgniteCache<String, Object> cache = (IgniteCache<String, Object>) ignite.getOrCreateCache(cacheCfg);

Now when i try to delete the cache using IgniteCache.destroy() API, it is taking about 12-13 seconds.

Why is it taking more execution time? Will there be any exchange of cache information among the nodes whenever a cache is deleted?
Is there any way in which, the execution time can be optimized?

Regards,
Shravya Nethula.




Outlook-5hxeghjc.png (1K) <http://apache-ignite-users.70518.x6.nabble.com/attachment/29071/0/Outlook-5hxeghjc.png>
akorensh akorensh
Reply | Threaded
Open this post in threaded view
|

Re: IgniteCache.destroy() taking long time

Hi,
    Can you please share your cache configuration.  How many nodes do you have in your cluster?
    If you are running in PARTITONED mode then some exchange of information will occur.  
    Do you have a reproducer project?  
Thanks, Alex
  

On Wed, Aug 14, 2019 at 1:22 AM Shravya Nethula <[hidden email]> wrote:

Hi, 

I have created a cache using the following API: 
IgniteCache<String, Object> cache = (IgniteCache<String, Object>) ignite.getOrCreateCache(cacheCfg); 

Now when i try to delete the cache using IgniteCache.destroy() API, it is taking about 12-13 seconds. 

Why is it taking more execution time? Will there be any exchange of cache information among the nodes whenever a cache is deleted? 
Is there any way in which, the execution time can be optimized? 

Regards, 
Shravya Nethula.


Regards,

Shravya Nethula,

BigData Developer,


Hyderabad.

Denis Mekhanikov Denis Mekhanikov
Reply | Threaded
Open this post in threaded view
|

Re: IgniteCache.destroy() taking long time

Folks,

Partition map exchange (PME) will actually happen in both cases: PARTITIONED and REPLICATED.
We need to understand, which part of the destroy is the longest.

If you enable INFO logs, then you’ll see messages about partition map exchange happening when you destroy caches.
Check, whether PME takes most time, or it’s fast and something else is blocking the destruction.

Could you tell, how many nodes you have in your cluster?

Denis

On 14 Aug 2019, at 18:11, Alexander Kor <[hidden email]> wrote:

Hi,
    Can you please share your cache configuration.  How many nodes do you have in your cluster?
    If you are running in PARTITONED mode then some exchange of information will occur.  
    Do you have a reproducer project?  
Thanks, Alex
  

On Wed, Aug 14, 2019 at 1:22 AM Shravya Nethula <[hidden email]> wrote:

Hi, 

I have created a cache using the following API: 
IgniteCache<String, Object> cache = (IgniteCache<String, Object>) ignite.getOrCreateCache(cacheCfg); 

Now when i try to delete the cache using IgniteCache.destroy() API, it is taking about 12-13 seconds. 

Why is it taking more execution time? Will there be any exchange of cache information among the nodes whenever a cache is deleted? 
Is there any way in which, the execution time can be optimized? 

Regards, 
Shravya Nethula.



Regards,
Shravya Nethula,
BigData Developer,

<Outlook-5hxeghjc.png>
Hyderabad.


Shravya Nethula Shravya Nethula
Reply | Threaded
Open this post in threaded view
|

Re: IgniteCache.destroy() taking long time

In reply to this post by akorensh


The following is the cache configuration:


CacheConfiguration cacheCfg = new CacheConfiguration(tableName);
    cacheCfg.setCacheMode(CacheMode.PARTITIONED);
    cacheCfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
    cacheCfg.setBackups(1);
    cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.PRIMARY_SYNC);
    cacheCfg.setRebalanceBatchSize(1024 * 1024 * 4);
    cacheCfg.setRebalanceMode(CacheRebalanceMode.ASYNC);
    cacheCfg.setStatisticsEnabled(true);
    cacheCfg.setRebalanceDelay(100);
    cacheCfg.setDefaultLockTimeout(5000);
    cacheCfg.setReadFromBackup(true);
    cacheCfg.setQueryParallelism(16);
    cacheCfg.setRebalanceBatchesPrefetchCount(4);
    cacheCfg.setNodeFilter(new AttributeNodeFilter("ROLE", "data.compute"));

There are 2 nodes in our cluster.



From: Alexander Kor <[hidden email]>
Sent: Wednesday, August 14, 2019 8:41:31 PM
To: [hidden email] <[hidden email]>
Subject: Re: IgniteCache.destroy() taking long time
 
Hi,
    Can you please share your cache configuration.  How many nodes do you have in your cluster?
    If you are running in PARTITONED mode then some exchange of information will occur.  
    Do you have a reproducer project?  
Thanks, Alex
  

On Wed, Aug 14, 2019 at 1:22 AM Shravya Nethula <[hidden email]> wrote:

Hi, 

I have created a cache using the following API: 
IgniteCache<String, Object> cache = (IgniteCache<String, Object>) ignite.getOrCreateCache(cacheCfg); 

Now when i try to delete the cache using IgniteCache.destroy() API, it is taking about 12-13 seconds. 

Why is it taking more execution time? Will there be any exchange of cache information among the nodes whenever a cache is deleted? 
Is there any way in which, the execution time can be optimized? 

Regards, 
Shravya Nethula.


Regards,

Shravya Nethula,

BigData Developer,


Hyderabad.

Shravya Nethula Shravya Nethula
Reply | Threaded
Open this post in threaded view
|

Re: IgniteCache.destroy() taking long time

Hi Denis,


I have enabled the INFO logs and tried to delete a cache. Please find the logs below:


Aug 20, 2019 11:00:17 AM org.apache.ignite.logger.java.JavaLogger info
INFO: Stopped cache [cacheName=Person]
cache deleted in:17280 ms ---->>> This is a print statement from our code
Aug 20, 2019 11:00:17 AM org.apache.ignite.logger.java.JavaLogger info
INFO: Completed partition exchange [localNode=90c11807-ac10-43a6-b7b6-605d5c07314d, exchange=GridDhtPartitionsExchangeFuture [topVer=AffinityTopologyVersion [topVer=5891, minorTopVer=2], evt=DISCOVERY_CUSTOM_EVT, evtNode=TcpDiscoveryNode [id=90c11807-ac10-43a6-b7b6-605d5c07314d, addrs=[0:0:0:0:0:0:0:1%lo, 127.0.0.1, 192.168.1.116, 192.168.1.249], sockAddrs=[device-shravya-hp/192.168.1.249:0, /0:0:0:0:0:0:0:1%lo:0, /127.0.0.1:0, /192.168.1.116:0], discPort=0, order=5890, intOrder=0, lastExchangeTime=1566278969558, loc=true, ver=2.7.0#20181201-sha1:256ae401, isClient=true], done=true], topVer=AffinityTopologyVersion [topVer=5891, minorTopVer=2], durationFromInit=16882]
Aug 20, 2019 11:00:17 AM org.apache.ignite.logger.java.JavaLogger info

It looks like partition exchange is taking more time. How can this be avoided?
What is the importance of Partition exchange?



Regards,

Shravya Nethula.



From: Shravya Nethula <[hidden email]>
Sent: Monday, August 19, 2019 6:06:36 PM
To: [hidden email] <[hidden email]>
Subject: Re: IgniteCache.destroy() taking long time
 


The following is the cache configuration:


CacheConfiguration cacheCfg = new CacheConfiguration(tableName);
    cacheCfg.setCacheMode(CacheMode.PARTITIONED);
    cacheCfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
    cacheCfg.setBackups(1);
    cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.PRIMARY_SYNC);
    cacheCfg.setRebalanceBatchSize(1024 * 1024 * 4);
    cacheCfg.setRebalanceMode(CacheRebalanceMode.ASYNC);
    cacheCfg.setStatisticsEnabled(true);
    cacheCfg.setRebalanceDelay(100);
    cacheCfg.setDefaultLockTimeout(5000);
    cacheCfg.setReadFromBackup(true);
    cacheCfg.setQueryParallelism(16);
    cacheCfg.setRebalanceBatchesPrefetchCount(4);
    cacheCfg.setNodeFilter(new AttributeNodeFilter("ROLE", "data.compute"));

There are 2 nodes in our cluster.



From: Alexander Kor <[hidden email]>
Sent: Wednesday, August 14, 2019 8:41:31 PM
To: [hidden email] <[hidden email]>
Subject: Re: IgniteCache.destroy() taking long time
 
Hi,
    Can you please share your cache configuration.  How many nodes do you have in your cluster?
    If you are running in PARTITONED mode then some exchange of information will occur.  
    Do you have a reproducer project?  
Thanks, Alex
  

On Wed, Aug 14, 2019 at 1:22 AM Shravya Nethula <[hidden email]> wrote:

Hi, 

I have created a cache using the following API: 
IgniteCache<String, Object> cache = (IgniteCache<String, Object>) ignite.getOrCreateCache(cacheCfg); 

Now when i try to delete the cache using IgniteCache.destroy() API, it is taking about 12-13 seconds. 

Why is it taking more execution time? Will there be any exchange of cache information among the nodes whenever a cache is deleted? 
Is there any way in which, the execution time can be optimized? 

Regards, 
Shravya Nethula.


Regards,

Shravya Nethula,

BigData Developer,


Hyderabad.