boutell: (Default)
Thanks to all, especially [ profile] iamo, for the thoughtful responses to my question about fastcgi.

I eventually figured out that the fastcgi "dynamic server" could live in a shared folder, resulting in only one set of PHP processes, if I used a simple Alias directive to map that path into all of the virtual sites.

With that change I was able to do this:
<IfModule mod_fastcgi.c>
  # One shared PHP-managed fastcgi for all sites
  Alias /fcgi /var/local/fcgi
  # IMPORTANT: without this we get more than one instance
  # of our wrapper, which itself spawns 20 PHP processes, so
  # that would be Bad (tm)
  FastCgiConfig -idle-timeout 20 -maxClassProcesses 1
  <Directory /var/local/fcgi>
    Options ExecCGI
  AddType application/x-httpd-php5 .php
  AddHandler fastcgi-script .fcgi
  Action application/x-httpd-php5 /fcgi/php-cgi-wrapper.fcgi

Coupled with the wrapper script I showed before, that works like a big working thing.

Then I switched Apache to the worker MPM rather than the prefork MPM (again, thanks for the suggestions), which really blew performance for static files through the roof.

The only remaining catch: no support for php_value settings in .htaccess files. Doh. Fortunately the settings I had in place there were easily shared among the virtual sites in question, so I swept them to php.ini.

(Yes, I know I really shouldn't have .htaccess files on sites where I'm concerned about performance anyway.)

Thanks again for the tips!
boutell: (Default)
Dear extremely amazing Apache geeks,

I don't ask much. I just want PHP to run in one process pool WITH a shared APC cache, and Apache to be in its own process pool as a front end so it can serve static stuff really, really fast, and not pin down a huge Apache process with mod_php in it when it's just serving something statically. Better yet I'd like to use the worker MPM so it's threaded and even more ridiculously fast.
fastcgi is supposed to be the way... clicky if you think you might be able to help. )
Thanks for your advice!

September 2014

2122232425 2627


RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Oct. 17th, 2017 10:17 pm
Powered by Dreamwidth Studios