"Cache Used" stat for buckets not working?
Mon, 06/14/2010 - 10:27
I am running Membase Memcached Server 1.03 on Windows 2008 Server.
In the web console, under "buckets", I can see each bucket and some basic stats. The "Cached Used" stat is currently showing ~90%. If I flush the cache (reset bucket to empty), this stat doesn't change and still shows ~90%.
My cache is 12 GB and I am using nowhere near 90% of it... and when I flush the bucket, I would expect the stat to go to zero. (the REST API also reports this same ~90% value)
Has anyone else seen this behavior?
Does the "cache used" stat work correctly?
-Corey Goldberg
Hi there Corey. You're definitely right that you would "expect" a flush to actually clear out all the data. In fact, the way that memcached works, a flush is actually a "lazy" operation in that it marks all of the items invalid but doesn't actually remove them. This is to prevent a huge CPU load (and possibly slowing down the server).
If you try to access one of the "flushed" items, the server will behave the same way as if that item was no longer there (or more accurately, had expired). As you put in new items, these "invalid" ones will be pushed out as needed.
Therefore, unfortunately, the stats are technically correct according to the server. Those items are still taking up space, but no client will be able to access them.
If you need to completely clear out the server, your best bet is to stop and restart it.
As an FYI, we will be changing/enhancing this behavior in later versions to make it clearer to the user.
Hope that answers your questions, feel free to follow up if you need more clarification.
Perry Krug
Forum support is great for free but sometimes you need a guaranteed response time and dedicated resources for your questions or issues.
Consider purchasing enterprise-level support from Membase: http://www.membase.com/products-and-services/overview
Call or email "sales -at- membase -dot- com" today!