Tradeoffs of IIS Hosting

Another one of those rules of thumbs that I hear often quoted but rarely demonstrated covers the performance of hosting a web service in IIS. Running a WCF service host in IIS is going to be more expensive than running that same service host in your own process. However, I've heard people quote figures of sixty, eighty, or even one hundred percent increases in throughput by self hosting. I have difficulty believing that in real practice the throughput is going to double by hosting a web service in your own process rather than in IIS. I would be less skeptical about numbers closer to twenty percent. Nevertheless, you should expect to see a difference because IIS is providing additional services for you.

In my mind, these are the most valuable services that you're trading off for that performance.

  • Application configuration, management, and diagnostics through the IIS management tools
  • Easier deployment and security setup assuming that IIS is already installed
  • Demand based activation of services
  • Health monitoring and automatic crash recovery
  • Better compatibility with ASP.NET behavior

Conversely, if you find yourself trying to add these features to a self hosted web service, then you may want to think about using IIS instead because it will probably beat your implementation on performance.

Next time: AfterInvoke Must Run

Comments (7)

  1. BenK says:

    I would  not say IIS had better security configuration tham windows  services – the model is such a pain many admins ( who DONT know the product  , havent got time to learn and either push it back to the devs or end up  reducing security big time )

    Dont know about easier deployment either… I have gone back to  msi installs or xcopy with a batch file for services. Ever tried to cretae a new site with FrontPage extensions ? Or used click once for your client and wanted to change it to point at a different server ?

    If he site is idle for 10 min you get your app restarted.

    And the nicest feature of all – if a minor worker thread throws an exception you get your app domain restarted.

    There are a lot of things to worry about if you have admins experienced in IIS on Windows 2003 as app servers then its a good tool otherwise Windows Services will save you time and money IMHO.



  2. William says:

    I’m wondering which version of IIS you are using…?

  3. Ben-

    I consider xcopy a pretty good deployment strategy with IIS.  I think it’s easier to be xcopy friendly in a hosted environment than with your own service.  There’s simply less system things to set up as you don’t have to worry about SCM, environment, port sharing, firewall exceptions, etc.  That’s why I said assuming IIS is already installed and working.

  4. William-

    I recommend IIS6 for most HTTP apps today (IIS7 is a requirement for non-HTTP apps).

  5. I’m setting up a custom principal for the current thread based on the received messages, but the principal

  6. alik levin's says:

    This is a digest of WCF Security resources I was collecting for some time. Drop me a comment in case

  7. 江南白衣 says:

    This is a digest of WCF Security resources I was collecting for some time. Drop me a comment in case it is useful.

Skip to main content