Home  /  RSS  /  RSS Comments  /  Enter

IIS Supports FastCGI? Not really!

8/17/11, by artyom ; Posted in: FastCGI; 5 comments

IIS officially supports FastCGI and even provides built-in module starting from version 7.0.

Does it mean that you can now develop generic applications that use the industry standard widely supported API and deploy them with IIS?

Not really.

Several things you should know about IIS and FastCGI:

  1. It does not support multi-threaded FastCGI applications. That means your generic application would be able to process only a single request per process.

    Even the standard example that comes with the most popular fastcgi library implementation would not work.

    This basically means: you can't implement with IIS/FastCGI long polling techniques, or share some cache between multiple worker threads of the same process.

  2. It does not allow you to use external FastCGI applications - something very common in web servers world. All popular web servers: Apache, Lighttpd, Nginx fully support it/

    IIS must manage your application life cycle and does not allow you "to do what you think is good for you".

This basically means only one things: FastCGI support for IIS was designed to run PHP... Nothing more.

One again - Microsoft takes very good generic standard and... succeeds to implement it in the most horrible way.

Comments

John McLear, at 8/17/11, 10:22 PM

Couldn't agree more, I tried to deploy some stuff using FastCGI on IIS and the performance was terrible. I should also mention that deployment is awkward and horribly buggy. Afaik the docs on microsoft.com don't work so I had to dig around to find a developers blog that had the complete install guide...

Geoffrey Thomas, at 8/18/11, 2:11 AM

This is misleading. Apache's mod_fcgid does not support multi-threaded FastCGI applications either -- it will only deliver one request to an application at a time. It's capable of spawning more processes as needed.

And when using shared hosting, there's no good place to put persistent FastCGI sockets, so you use Apache-spawned FastCGIs, letting Apache manage the application life cycle. It works fine.

I run a large server (several thousand users) using Apache which only supports mod_fcgid in the shared hosting context, and it works out just fine. We have several users running Django, TurboGears, Flask, Rails, etc. etc. (In fact, PHP is the one thing we don't use FastCGI for.) IIS may have its flaws, but these don't seem to be it.

artyom, at 8/18/11, 10:11 AM

This is misleading. Apache's mod_fcgid does not support multi-threaded FastCGI applications either

Yes, but mod_fastcgi that is much longer around supports it perfectly well.

And when using shared hosting, there's no good place to put persistent FastCGI sockets

First of all you don't have to use external FastCGI application on shared hosting, you still may use one application that is controlled by the web server - and it would use threading internally.

FastCgiServer /opt/app/bin/hello -socket /tmp/hello-fcgi-socket
FastCGIConfig -maxProcesses 1 -processSlack 1
ScriptAliasMatch ^/hello(.*)$ /opt/app/bin/hello$1
AddHandler fastcgi-script /opt/app/bin/hello

Works very well.

I run a large server (several thousand users) using Apache which only supports mod_fcgid in the shared hosting context, and it works out just fine.

See, I'm not telling that IIS does not run single threaded FastCGI applications - it does, but this is not enough.

Martin Packwood, at 3/14/15, 1:22 PM

Thanks for the clear info about this. Saved me quite a bit of head banging. It's a simple protocol as well so very disappointing.

Patrick Wolf, at 12/8/16, 11:42 AM

I must confess that your framework is awesome.

I have just come across your blog post which is interesting to me as I plan to deploy a website based upon cppcms and I am looking for some hints on how to switch from mod_fastcgi to mod_fcgid.

I have a VPS with centos 6 and the official repositories do not provide mod_fastcgi anymore. On my Debian development environment, I am doing tests with the recommended mod_fastcgi. In order to get it working once it is deployed to production with mod_fcgid, I have to switch to this module which has a complete different behaviour and setting.

Could you please give me some support on how to configure it? I tried in vain but it is very slow on my development environment and the css and media files do not load.

Add Comment:

 
 the email would not displayed
 

You can write your messages using Markdown syntax.

You must enable JavaScript in order to post comments.

Pages

Categories