Question about gc_interval & var_gc_interval

42 views
Skip to first unread message

Xrvel Xrvel

unread,
May 22, 2016, 11:44:01 AM5/22/16
to XCache
Hello,

I have read the xcacheini wiki.
I read that the "ttl" setting will clear cache X seconds after the cache is created (not accessed).

What about the "gc_interval" & "var_gc_interval" ?
Is there any pros & cons in using garbage collector in xcache?

Thank you.

Xuefer

unread,
May 22, 2016, 12:08:53 PM5/22/16
to xca...@googlegroups.com
pros: when some *.php is deleted, gc can remove them
cons: make memory fragment

gc_interval/var_gc_interval is how often gc is executed
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "XCache" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to xcache+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

Xrvel Xrvel

unread,
May 22, 2016, 12:59:34 PM5/22/16
to XCache
Hello.

I very rarely delete / modify PHP file, so i think i will make gc_interval disabled (0) then.

What about the var_gc_interval, in what situation it will be executed?

Thank you.

Xuefer

unread,
May 22, 2016, 1:08:37 PM5/22/16
to xca...@googlegroups.com
set up XCache admin pages and you'll see a GC count down. down to 0
and it will be executed

Dicky Kurniawan

unread,
May 22, 2016, 1:14:03 PM5/22/16
to xca...@googlegroups.com
Which cached variables will be considered as "garbage" and cleaned by variable garbage collection process?

For example are they variables which have not been accessed within certain time range?
Or "var_gc_interval" works just same like "var_ttl", which all variables will expire (no matter when it has been accessed recently or not) ?

Thank you.

Xuefer

unread,
May 22, 2016, 1:44:23 PM5/22/16
to xca...@googlegroups.com
#define VAR_ENTRY_EXPIRED(pentry) ((pentry)->ttl && XG(request_time) > (pentry)->ctime + (time_t) (pentry)->ttl)

ctime = created time
ttl = time to live == xcache.var_maxttl ? min(xcache.var_maxttl, ttl) : ttl;
--

Xrvel Xrvel

unread,
May 22, 2016, 2:07:52 PM5/22/16
to XCache
Thank you very much for the answer.
Reply all
Reply to author
Forward
0 new messages