When should we host the WCF service in IIS and when should we host the Windows service?

I need to host my WCF service, but I cannot decide whether to host it in IIS or in a Windows service?

What are the advantages, disadvantages, advantages of one over the other, please?

thanks

+6
source share
2 answers

IIS in version 7 is out of the question of any serious hosting.

Regarding IIS7 + / WAS vs. NT Self-Service:

  • the IIS7 / WAS setup will "boot on demand", for example. when you enter your first request, a ServiceHost will be created, then this service host creates a class of service to handle the request. This is useful from a memory point of view (does not use memory for ServiceHost if no requests are received), but this is a bit of additional overhead for the first call when IIS must first spin up the service host

  • NT Service allows you to pre-create a ServiceHost and open it so that it immediately processes requests; a bit more memory usage, but a little more responsive, at least on the “first calls”

Another advantage of self-service: you are 100% responsible for starting the service host, pause, stop, etc. With IIS / WAS, you occasionally find yourself in the grip of IIS with the ability to process application pools at the worst possible moment ......

+4
source

The main advantages of IIS is that it serves your service for you: activation, disposal ...

Its main drawback, if you do not have v7, is that without WAS, it can host only http-based web services

Services need more attention in the event of a fatal error ... and then must be installed, while the website can be copied to its web folder after its creation.

If your version of iis is> = 7, then I don’t see much interest in not using WAS, since it supports all wcf transports, others may have a different view, though ...

+2
source

Source: https://habr.com/ru/post/898090/


All Articles