ignite cache get performance issue when Key, Value not exist

classic Classic list List threaded Threaded
5 messages Options
kevin.zheng kevin.zheng
Reply | Threaded
Open this post in threaded view
|

ignite cache get performance issue when Key, Value not exist

Hi there,

When I am using cache.get(key) operation to find some value.

I notice that if the key is not exist (neither no record in the database too), the performance is really slow: about 830ms to return the null result;

BTW, I have set read through and write-behind for this cache, also I add near cache configurations when create this cache.

 

Is it a bug?

 

Cheers,
Kevin

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

Re: ignite cache get performance issue when Key, Value not exist

Hi Kevin,

This happens because such information is not “cached” in the internals meaning that every time the database will be queried to see whether it has such a key or not. If you disable the database the performance should be good.

In any case how critical is this for you? Is it some basic use case for you to query for non existed keys?

Denis

On Jun 8, 2016, at 6:26 AM, Zhengqingzheng <[hidden email]> wrote:

Hi there,
When I am using cache.get(key) operation to find some value.
I notice that if the key is not exist (neither no record in the database too), the performance is really slow: about 830ms to return the null result;
BTW, I have set read through and write-behind for this cache, also I add near cache configurations when create this cache.
 
Is it a bug?
 
Cheers,
Kevin

kevin.zheng kevin.zheng
Reply | Threaded
Open this post in threaded view
|

Re: ignite cache get performance issue when Key, Value not exist

Hi Denis,
the case may be avoid by checking if key exists. and also I can load all the data into cache and disable the read through settings.

thanks for your suggestion.

Cheers,
Kevin
Denis Magda Denis Magda
Reply | Threaded
Open this post in threaded view
|

Fwd: ignite cache get performance issue when Key, Value not exist

In reply to this post by kevin.zheng
Igniters,

This is not the first time I hear about from the community side about the performance issue Kevin is talking below.

In short if a key is not located in a cache then we will go to an underlying storage. This process will be repeated all the time for the same key and this leads to performance degradation in cases when someone needs to check whether a key exists before applying an action.

Probably we can use already existed remove queue to cache such queries of non existed keys. Any thoughts & ideas?

Denis

Begin forwarded message:

From: Zhengqingzheng <[hidden email]>
Subject: ignite cache get performance issue when Key, Value not exist
Date: June 8, 2016 at 6:26:17 AM GMT+3
Reply-To: [hidden email]

Hi there,
When I am using cache.get(key) operation to find some value.
I notice that if the key is not exist (neither no record in the database too), the performance is really slow: about 830ms to return the null result;
BTW, I have set read through and write-behind for this cache, also I add near cache configurations when create this cache.
 
Is it a bug?
 
Cheers,
Kevin

Kristian Rosenvold Kristian Rosenvold
Reply | Threaded
Open this post in threaded view
|

Re: ignite cache get performance issue when Key, Value not exist

In reply to this post by Denis Magda
I have a related question which I have been trying to find the answer to in the docs: Given a cache REPLICATED cache with CacheRebalanceMode.SYNC, is there any meaningful use case for a readthrough handler ? (Is there any situation where the readthrough database can actually produce a result that is not known to the local cache ???)

It feels like there's a bit of documentation that could be written about how these options affect each other ?

Kristian





2016-06-08 6:47 GMT+02:00 Denis Magda <[hidden email]>:
Hi Kevin,

This happens because such information is not “cached” in the internals meaning that every time the database will be queried to see whether it has such a key or not. If you disable the database the performance should be good.

In any case how critical is this for you? Is it some basic use case for you to query for non existed keys?

Denis

On Jun 8, 2016, at 6:26 AM, Zhengqingzheng <[hidden email]> wrote:

Hi there,
When I am using cache.get(key) operation to find some value.
I notice that if the key is not exist (neither no record in the database too), the performance is really slow: about 830ms to return the null result;
BTW, I have set read through and write-behind for this cache, also I add near cache configurations when create this cache.
 
Is it a bug?
 
Cheers,
Kevin