lighttpd forum XCache > Garbage Collection && TTL Questions

Posted by Schiz0 (Guest)
on 27.06.2008 15:12
Hey everyone,

I recently started playing with XCache on a FreeBSD + Apache2 + PHP5 
box. So far, it seems like it's decreasing load time for pages quite a 
bit :-D

I have a few questions about the settings in php.ini for xcache. My 
current settings are located at:
http://pastebin.com/f5d6fddcf

1. If I change a php file on the server, will the cache continue serving 
the OLD opcode until the TTL expires and it reloads it? I think I read 
somewhere that xcache checks the timestamp on the file, but I can't seem 
to find out where it says that now. If it does check the timestamp, then 
I can set the ttl to 0 without any problem, right?

2. What exactly is garbage collection? Is it when the items marked 
expired/deleted are actually removed from memory? By default, 
"xcache.gc_interval" is set to 0, which means no garbage collection will 
happen...Is this recommended?

And one last question. My server has 2 x dual-core Xeons (total of 4 
cores), with 2 GB ram. I'm running a php site, including a MediaWiki. 
Are my "size", "count", and "slots" settings correct? I have the admin 
panel installed and I'll be keeping an eye on the statistics in there, 
but I'd like an experienced user's opinion.

Thanks for all/any replies. The help is greatly appreciated.
Posted by moo XCache
on 27.06.2008 17:29
Schiz0 wrote:
> Hey everyone,
> 
> I recently started playing with XCache on a FreeBSD + Apache2 + PHP5 
> box. So far, it seems like it's decreasing load time for pages quite a 
> bit :-D
> 
> I have a few questions about the settings in php.ini for xcache. My 
> current settings are located at:
> http://pastebin.com/f5d6fddcf
> 
> 1. If I change a php file on the server, will the cache continue serving 
> the OLD opcode until the TTL expires and it reloads it? I think I read 
> somewhere that xcache checks the timestamp on the file, but I can't seem 
> to find out where it says that now. If it does check the timestamp, then 
> I can set the ttl to 0 without any problem, right?
sure, as long as xcache.stat=on, files will be auto reload whenever the 
file is changed
> 
> 2. What exactly is garbage collection? Is it when the items marked 
> expired/deleted are actually removed from memory? By default, 
> "xcache.gc_interval" is set to 0, which means no garbage collection will 
> happen...Is this recommended?
gc will lead to fragments and it would be good if you cache all the 
scripts that is used, if you have enough memory. so it is disabled by 
default. but it could be useful for some ppl.

> 
> And one last question. My server has 2 x dual-core Xeons (total of 4 
> cores), with 2 GB ram. I'm running a php site, including a MediaWiki. 
> Are my "size", "count", and "slots" settings correct? I have the admin 
> panel installed and I'll be keeping an eye on the statistics in there, 
> but I'd like an experienced user's opinion.
one size does not fit all so i cannot recommend any "best" values. thus 
i wish more users will study how to tune these options for performance, 
and tech others.
> 
> Thanks for all/any replies. The help is greatly appreciated.