SOLVED: Apache + FastCGI + eAccelerator = Cache Cleared Every Page Load

244 views
Skip to first unread message

Matt Janssen

unread,
Oct 14, 2010, 9:30:14 AM10/14/10
to eaccelerator
I had the following problem for about a day before figuring out what
was happening...

Every page load, the cache--both memory and disk--would be "reset" on
every page load. I tried debugging with
print_r(eaccelerator_cached_scripts()); and
print_r(eaccelerator_info()); at both the header and footer of my
pages. At the head, only one script was in cache (the index.php
script) and at the bottom, all 380 scripts were cached (each accessed
for the first time). On the next page load, it started all over again.

I tried both Apache MPM Worker mode and Prefork mode and would get the
same results. Finally I took FastCGI out of the picture and used
php_mod ... eAccelerator worked! That got me thinking that perhaps
eAccel was attaching to the FCGI process, which was destroyed after
every page load. Yup, that was it.

The solution was to tell FastCGI, through httpd.conf (or
mod_fastcgi.conf) to keep a minimum of one FCGI process running at all
times:

FastCgiConfig -singleThreshold 1

And there we go. All the scripts were cached and accessed at this
point. I'll post back if we have any more issues with this setup.
Reply all
Reply to author
Forward
0 new messages