On Oct 6, 3:19 am, Pankaj Kumar <[email protected]> wrote:
> We thought of using curr_item of stat to check the current number of > items in the cache, but even if the object is expired, its not > updating it. When client application hits the cache server and it > returns null as item has been expired then the count decreases by one. > So this number doesn't represent the actual number of items in the > cache. Can you please help me with this? Is there any other way to get > the actual number of items in the cache at a given time? You are encountering what is commonly referred to as the Fitzpatrick Uncertainty Principle. You may know how many items are in the cache and whether items are available for retrieval, but not both at the same time. In this particular case, there *are* curr_items in the cache, but many have expired. Expiration is lazy, so you don't know they're expired until you retrieve them. If your goal is to determine the availability of your process, you could perhaps add a counter that increments upon successful completion of your process. Your monitoring can both monitor the velocity of the counter as well as the cache miss rate to report how healthy your system is.
