Flush isn't working?

Apr 21, 2010 at 8:52 PM

I don´t see the number of items stored go down after doing Flush or FLushAll. Any ideas?

Apr 23, 2010 at 12:01 AM

Flush/FlushAll with memcached will not actually flush any items from the cache or free any memory. Below is a snippet from the memcached protocol. Let me know if you need more information. Thanks!



Other commands

"flush_all" is a command with an optional numeric argument. It always
succeeds, and the server sends "OK\r\n" in response (unless "noreply"
is given as the last parameter). Its effect is to invalidate all
existing items immediately (by default) or after the expiration
specified.  After invalidation none of the items will be returned in
response to a retrieval command (unless it's stored again under the
same key *after* flush_all has invalidated the items). flush_all
doesn't actually free all the memory taken up by existing items; that
will happen gradually as new items are stored. The most precise
definition of what flush_all does is the following: it causes all
items whose update time is earlier than the time at which flush_all
was set to be executed to be ignored for retrieval purposes.