It seems that every time we get on Slashdot (or Digg for that matter), we go down. It doesn’t make a difference just how well prepared we are, what kind of hosting we’re using, what the application being Slashdotted is, etc. It’s the unwritten law at NST. But we hope this’s the last time we ever experience downtime for a while.1
Why? We’ve left PHP. Well, not exactly. It seems that PHP doesn’t give a damn about Windows users. PHP has repeatedly stated that “we’re aware of [….] serious stability issues on Windows…” But they’ve done nothing about it for almost a year now. Their advice is to abandon (their own) PHP ISAPI connector and instead fallback to the ages-old and incredibly slow PHP CGI solution.
A couple of years ago, a more efficient “version” of CGI, aptly dubbed “FastCGI,” was invented. Theoretically, FastCGI retains the stability and reliance of the old CGI method, but is implemented via its own (actually working) ISAPI/NSAPI extension and incorporates some changes in the lifeline of a binary. But in practice, the original FastCGI for IIS implementation is outdated and almost as unreliable as ISAPI on IIS.
At NeoSmart Technologies, we’ve been using the original PHP ISAPI implementation to get our various PHP-powered scripts up and running. It’s proven to be as unreliable as only badly-coded software can be, but falling back to CGI as a “solution” just wasn’t going to happen. But now we’ve come across a much un-mentioned FastCGI implementation created by Microsoft themselves in an effort to increase the reliability of PHP on IIS since PHP weren’t doing their jobs.
The not-so-sharply-named “FastCGI for IIS” plugin seems to be the real deal. At the moment, it supports IIS 5 & 6 via the now-dying ISAPI infrastructure – and is a complete modular implementation for IIS 7. Unlike the other FastCGI implementations for IIS, this one really works. It load-balances requests across multiple threads (just like CGI does), and properly recycles them when threads end (just like CGI doesn’t).
Most importantly, it’s fast, lite, & trouble-free. Only time can tell, but this does seem like the real McCoy, if you will. For the past 2 days NST has been available only off-and-on thanks to Slashdot (linking to this story) – and PHP’s ISAPI extension just can’t handle all those requests, and needed a reset every hour. We’ve just switched to FastCGI for IIS, and so far, so good!
Besides just the facts and resources currently sitting on our server, FastCGI for IIS spews good “vibes” all over the place. It’s nothing tangible, and we obviously won’t have any numbers until the next Slashdot effect comes in, but we’re going to go ahead and advise that anyone frustrated with PHP’s lack of stability and uptime on Windows servers (and IIS in particular) should switch right away.
It’s really sad that PHP ignores a huge portion of the market. Sure, Linux is a great server product, and Apache really is wonderful (after all, Microsoft has admitted to using Apache’s modular structure as their inspiration for IIS 7!) – but IIS 6 (and 7 too) are decent web servers in their own right. It doesn’t make sense that they should serve Perl, Python, and ASP.NET 2.0 so well, and just stumble head-over-heels when it comes to PHP.2