what about the max expires time, 30days?

393 views
Skip to first unread message

kedy211

unread,
Aug 26, 2010, 11:19:39 PM8/26/10
to memc...@googlegroups.com
It's unusually the question I mentioned in the topic. And, I can NOT find the offical answer from wiki.

Sometime, I set the expire time as '86400 * 24 * 4', the func memcached->set will return true, bug false when get.

I have tested the max expire time, the result is 86400 * 24 * 1.25, in others words: 30 days.

So what about the max time in your server? Does it relations to the hardware or it's own version?

My OS & env Info:
Dell PE R610
Intel(R) Xeon(R) CPU E5504  @ 2.00GHz * 2
16G memory
Linux mdev 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
Memcached ver: 1.0.1




Best regards.

Kedy

kedy211

unread,
Aug 26, 2010, 11:25:35 PM8/26/10
to memc...@googlegroups.com
Sorry, it's BUT, not bug. (but false when get.)

Best regards.

Kedy

Dormando

unread,
Aug 26, 2010, 11:26:00 PM8/26/10
to memc...@googlegroups.com
Expire time turns into a unixtime date after 30 days. It's in the protocol.txt but possibly overlooked in the wiki :(

kedy211

unread,
Aug 26, 2010, 11:38:00 PM8/26/10
to memc...@googlegroups.com
Thanks.
 
I got the defined code in the memcached.c:
 
#define REALTIME_MAXDELTA 60*60*24*30

It's extreme question. DB or filecahce will be smart choise when it's necessary to cache sth more than 3days.


Kedy

Brian Moon

unread,
Aug 26, 2010, 11:46:01 PM8/26/10
to memc...@googlegroups.com, kedy211
On 8/26/10 10:38 PM, kedy211 wrote:
> Thanks.
> I got the defined code in the memcached.c:
> #define REALTIME_MAXDELTA 60*60*24*30
>
> It's extreme question. DB or filecahce will be smart choise when it's
> necessary to cache sth more than 3days.

The best solution is to always use a unix timestamp. If you want a 300
second ttl, set the ttl to time() + 300. Then you never have to worry
about it.

--

Brian.
--------
http://brian.moonspot.net/

Reply all
Reply to author
Forward
0 new messages