KVM Caching Strategy

Not applicable

I'm working with a client and after we updated the KVM via a management API call there was a delay in the proxy's ability to retrieve the updated value from the KVM. The delay varied between users. My delay was about 5 minutes, but other users stated that they experienced a longer delay. This is a single data center installation.

I have couple of questions regarding this topic:

1) Is there documentation that describes the caching used by the KVM? Does the KVM follow a similar caching strategy as used by the Cache policies?

Documentation for the Cache (Ehcache) implementation is listed in the following link

http://docs.apigee.com/api-services/content/cache-internals

I read several posts that hint at the KVM caching strategy, so it would be nice to have more details on it.

https://community.apigee.com/questions/7251/inconsistent-results-from-kvm.html

https://community.apigee.com/questions/7800/kvm-suitability-for-storing-small-data.html

The docs also state that there is cache:

<ExpiryTimeInSecs> element For a GET from the KeyValueMap, specifies the duration in seconds after which Edge refreshes its cached value from the KeyValueMap. A value of -1 means the GET value never expires and, because the value never expires, Edge never refreshes its cached value from the KeyValueMap.

2) The following article mentions that every time a KVM lookup request is issued, then all the entries are retrieved, even though you specify the key. Has this been resolved or changed in later releases?

https://community.apigee.com/articles/1396/apigee-developer-heres-the-stuff-you-should-know.html

3) Is it possible to explicitly invalidate the KVM, and force a cache update, similar to the invalidate cache policy? If not, then is there a way to change how quickly this update propagates using the Apigee conf files?

I know that updating an entry in the KVM invalidates the cache eventually, but I'm curious to understand how this process works and whether or not it can be configured.

1 4 1,216
4 REPLIES 4

Hi @seanwilliams do you have any update on this topic, we inadvertently set -1 on our environment level KVM lookup for a particular value and now I cannot change that value even if I create a new KVM, seems like the mapIdentifier is not being used.

hey @Kurt Kanaskie No update on this. I'm surprised that even though you delete the KVM and create a new one that the original value remains in the new KVM. That seems odd.

Right, that's what I was doing. I noticed today that the KVM cache does get refreshed, but its not deterministic, perhaps the MP restarted. We are going through our proxies and updating the time to be 300 seconds, hopefully the MPs will catch up.

Well, not trusting the nondeterministic nature of KVM cache refresh in MPs I decided to update all my KVM-operation policies to not use "-1" and to use newly created KVMs. This way I know for sure the cached values in the MP are deterministic.