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)
The chase continues! Tom finds the smoking gun. But the victim absorbs bullets without apparent harm. Or is there internal bleeding? And does anybody grok the Apache source code on a really deep level, mannnn? )
So I spent a lot of time struggling to improve the guestbook article and the votes were all from black hat scripts out there in the big bad wild. Let this be a lesson unto you... if someone appears to be innocent, try ripping their face off! You know, like in "V!"

September 2014

2122232425 2627


RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

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