Sergio Ordine

Hi Everybody!

We are starting a new project for a high available web system and we are thinking about using WCF to provide the required services. Probably we will use server clusters in order to provide the required availability, but we don't know yet if the solution shall use 3 levels of clustering (web, application/business and database) or 2 (web/application and database) as it depends on the customer budget.

I'd like to know which solution would be more suitable: hosting the WCF services as NT Services or within IIS. Could you help me regarding the pros/cons of using each one considering:

1 - How easy each one adapts to the clustering hardware solution

2- Performance

3 - Security

4 - How easy the development/configuration/deployment is



Re: Windows Communication Foundation (Indigo) WCF hosting: NT Service X IIS?

Michele Leroux Bustamante

The first key difference you want to know is that IIS enables message-based activation of your services - that is, IIS will initialize the ServiceHost instance when the first request arrives, and eventually release that resource during idle time to conserve. IIS also has application pooling and health monitoring capabilities that are not available when you roll your own solution. The only problem with IIS is that it can only handle HTTP protocol. You need "WAS" for a similar solution over any protocol - but that is only VIsta and Longhorn thus for a server platform, not yet.

The general guidance is - use IIS for HTTP services (outward facing, interoperable services) and use WIndows Services for internal, behind the firewall, non-interoperable communications.

To answer your questions:

  1. Clustering issues are more related to the protocols you enable, not the hosting environment. If you use session of any kind in WCF (application, reliable sessions, secure sessions) you must use sticky sessions and redirect requests to the same box since WCF doesn't support state server or durable sessions at this time.
  2. Performance is a factor of the protocols used. HTTP/Text is less performant than TCP/binary. Thus, your hosting choice is made for you.
  3. Security is the same, it is a binding level choice.
  4. Development is the same, configuration is the same. The only extra work you create with Windows Services is in the deployment step to install and configure the service, the allocation of appropriate process identity, and how you ensure availability (for example, while the service is restarting, no requests can come in, whereas IIS doesn't have this problem with the kernel level http.sys).

I hope that helps.

Re: Windows Communication Foundation (Indigo) WCF hosting: NT Service X IIS?

Sergio Ordine

Hi Michele!

It helped a lot! thanks!

Let me just ask one thing else regarding item 2 (Performance). HTTP/text is less performant than TCP/binary. Can I use HTTP with binary encoding If so, the difference between TCP/binary and HTTP/binary still significant

Re: Windows Communication Foundation (Indigo) WCF hosting: NT Service X IIS?

Michele Leroux Bustamante

Performance should not be the motivating factor. HTTP/Text is interoperable, HTTP can go through firewalls. That is your first consideration. Http/binary is something you could consider for behind firewall wcf-to-wcf communication, and perf will be faster because of both size of transfer and processing speed (no XML parsing). YOu can send large messages over HTTP with MTOM and acheive some level of perf increase as well.