For the past few days I’ve been playing around with eAccelerator on one of our hosting machines. Sounds pretty bad, but it’s completely controlled and I was quite confident it would run just fine. It is running just fine and has been for a few days and overall it’s made a tiny difference in overall load but not to much. The reason for this is the machine is not having issues with PHP serving but something else. But the caching of compiled PHP scripts still reduces CPU usage a bit and speeds up how quickly PHP pages load so it’s still worth it.
We’ve ran eAccelerator in the past with mod_php so I knew what to expect but it still has been a long time as we were using suPHP for ages. The one question mark in my head was just how much space would our cache directory take up in eAccelerator if we let it run without any real limitations put onto it. Well at this point in time it’s using a massive 3.7GB! This with most guides telling the person to put the cache directory in the tmp folder which would mean at this point we’d have almost filled our tmp folder twice! I’m going to let this to continue to run for a few weeks to get a real idea on how big our cache directory will be once everything is actually cached.
So I guess the one thing that I really wish it had was a way to get rid of stale cache files. It’ll do it with the shared memory portion but for the cached PHP files it does not. To me this can get out of hand if you are caching sites that receive 1 visitor a day yet you are stuck caching 30MB of PHP files or some silly amount.
Anyways I’ll probably post a follow up in a few weeks to talk about us putting it on all machines and in the end just how much space was used up by the cache directory.
4.3GB now at this point and seems to not be stopping. We’ll need to evaluate something else to do as caching these all on disk is just silly.
Did you ever figure out why that was happening on your server? I would assume it is related to the settings for the ttl values in your php.ini.
As far as I know eaccelerator has no limit on the amount of files it stores on the file cache portion. There is only a limitation on the shared memory portion. There are some tricks to handling this better like putting eaccelerator files in /dev/shm then wiping it out every hour via cron say. This would provide a much larger performance increase compared to the file cache and it will also be limited in space.