APC and CGI
| From: | Marten Lehmann | Date: | Wed, 19 Sep 2012 16:39:28 +0000 |
| Subject: | APC and CGI | ||
| Groups: | php.pecl.dev | ||
| Request: | Send a blank email to pecl-dev+get-9807@lists.php.net to get a copy of this message | ||
Hello,
I can't find any usable documentation for the usage of APC with PHP as CGI. But PHP as CGI behind a CGI wrapper in a shared hosting environment is the mostly used PHP configuration because this is what you get when you buy an effordable hosting plan to setup some small or medium sized websites with WordPress, Joomla, osCommerce etc. if you don't have a high traffic or lots of paying customers.
CGI means: There is no permanent process or daemon running. Each PHP process is created from scratch after Apache preforked a child process that calls the CGI wrapper which in turn calls PHP. That means the typical way - using shared memory to store opcode - doesn't work. This also means, that instead of using shared memory, another method to serialize and deserialize opcode has to be used. This might be files in a special cache directory or a memcached instance.
Unfortunately, I really can't find anything on that, but this is the use case, where page load speed would benefit most from caching by keeping and reusing the opcode. FastCGI daemons or mod_php keep a lot of stuff in memory anyway, so while the boost when using APC is surely noticable, it's not that much compared to what would be possible if a newly created PHP CGI process didn't had to load and parse a PHP-file and all its includes each time the script is called.
APC is not a young project, so I wonder that I can't find discussions about that.
Kind regards
Marten