Why does memcached impose a 30-day limit on the lifetime of cache entries?
In my system, I am always setting the lifetime to be 30 days, since that's the max allowed value. Setting it to a value much greater than 30 days would be ideal for my app.
Is there a way to change the "30-day" value to something else?
I am considering downloading the memcached source and recompiling it for my own use. I would either change the "30" to "300" or perhaps get rid of that check entirely. If I were to do this, would I be changing something that would cause memcached to malfunction or perform poorly? My expectation would be that items would be allowed to remain in the cache for longer, and they items would be removed from the cache when the cache gets full.
The expiration time in Memcached is in seconds. For instance, the default value is 10800 seconds. But, it can have a maximum value of 2592000 seconds that is, 30 days.
This may differ depending on the operating system or Linux distribution, but it varies between 64MB and 512MB. The more memory you can give to memcached, the better. We recommend at least 2GB, if you can afford it.
When deciding whether to use Redis or Memcached a major difference between these two is data persistence. While Redis is an in-memory (mostly) data store and it is not volatile, Memcached is an in-memory cache and it is volatile.
Using netcat This gives you extensive stats (uptime, version, HITS, MISSES, connections, evictions…) about the memcached daemon. If you wish to retrieve HITS in real-time, you can build upon this command and do the following. The number will then increase as soon as there's data coming in through the memcached daemon.
30 days is the limit at which we consider the time you specified to be a TTL from now.
If you want longer than 30 days, it's fine, just use an absolute time (time() + whatever
).
If you want no time-based expiration, as ConroyP says, just use 0
.
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