Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm having some performance problems with XCache and PHP5 running on a Ubuntu 8.04 server. A few Zend Framework applications peak at about 12MB of memory. General response time before Apache 2 can serve the page is around 550ms to 950ms. When I turn on XCache, restart Apache 2 and refresh the page the first time the results are the same. The second time however gives a increase of about 50%. Pages get served faster and peak memory is around 2MB to 4MB.

However, after a day of usage there's no more gain in using XCache. Peak memory usage and response time drop back to their old values.

I've tried increasing xcache.size to 64M (initially it was set to 16M). This helped, but only for a couple of hours. I've also set xcache.count to 4 as the server has a quad-core processor. However, this didn't seem to do it either so I changed the defaults of xcache.ttl to 3600 and xcache.gc_interval to 900. Hoping that old cache entries would expire. Still, no difference. When I manually invoke /etc/init.d/apache2 reload the cache seems to get reset and all is well again, for only a day or so.

The server is hosting a bunch of lighter PHP based websites and a couple of Zend Framework based ones. The latter really benefit from the performance increase by XCache.

Any ideas what to try next?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

Eventually it was a memory issue. I've increased the size to 194M and also made the gc_interval shorter, as well as the ttl.

We're hosting several PHP based websites (around 100 I think). Most of them are very light, but some use Zend Framework and different versions of them. The server has enough memory to spare so increasing the cache size and fiddling with the ttl and gc_interval made things a lot better.

Another tip, set up the XCache Administration page. Gives you a nice overview of what's being cached.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.