KVM miss hit always taking large time

Hi All

We are observing following behaviour in APIGEE X KVM Get Policy:

Success hit Case:  First hit takes ~20 ms and then successive success hits (with same key) takes ~ 1ms till <ExpiryTimeInSecs> reached.

Miss hit Case: All calls (with same key) are taking time ~20 ms.

Now question here is why it always takes long time in case of miss hit (key not present in KVM) while in success hit, the behaviour is different.

 

Thanks!

 

1 1 75
1 REPLY 1

That is an expected observation with the use of Caching. 

The KVM data is cached. When your API proxy asks a KVM policy to fetch data, the first thing it checks is the in-memory cache. If the data is not found there, the KVM needs to read from a persistent store. Reading from memory takes <1ms.  Reading from persistent store takes longer (10's of ms?)  

When the key does not exist in the store, there will always be a cache miss, therefore the KVM policy goes to the persistent store, and tries to read. Which incurs the o(10ms) cost. 

You might ask for Apigee to "fail faster" when there has been a prior cache miss for the key.  That seems like a reasonable request to me; you can submit that request for feature enhancement through Apigee support, or through your TAM or CE.