I'm having some problem with my app cache being flushed (page, action and fragment cache).
It looks like (according to the memcached IRC and the logfiles) the cache is being flushed very often, even though the cache isn't full.
I'm using:
Here is data being printed when running stats
using telnet.
I'm not using any expires_in
options when saving data to the cache.
Instead I use sweepers to flush the cache manually every night.
Anyone got an idea why this is happening?
When the amount of unwritten data in the cache reaches a certain level, the controller periodically writes cached data to a drive. This write process is called "flushing." The controller uses two algorithms for flushing cache: demand-based and age-based.
If flush is not carried out it may read junk data present in memory as the memory is not still updated with contents written to cache.
Whatever the case, you can "flush" your DNS cache to start from scratch, so your computer looks up web addresses on the DNS server again. This process is, of course, different from clearing your web cache from a web browser.
In general, I recommend not clearing your cache unless you have a specific reason to. The files in the cache allow the websites you visit most often to load faster, which is a good thing. Your browser will periodically delete old files, so it's not like the cache is going to keep growing forever.
It looks like you're running out of memcached space:
STAT limit_maxbytes 262144000
STAT bytes 209406773
...causing data to be evicted from the cache when you don't want it to and the stats show that:
STAT evictions 94777
Looks like you've configured a 250mb cache size and you're using 80-90%.
Try increasing the cache size via -m option.
UPDATE:
The stats also show your cache being manually flushed via Rails.cache.clear (sending memcached flush_all):
STAT cmd_flush 4317 # Original Stat Capture
STAT cmd_flush 48 # New Stat Capture
You should search your codebase for manual cache flushes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With