A co-worker and I are having a discussion about WFC services when the topic of “cost” comes up.
The question is this:
Given that an IIS-hosted WCF service and a Windows-Service-hosted WCF service do the exact same thing, which service will be more “expensive” with regard to memory and CPU cycles if they both are accepting the same load?
We are not concerned about initial start-up coding, installation or configuration (to which IIS seems geared to provide a simpler experience), just the bare-bones cost of running the services.
I cannot provide concrete figures, though if this is big concern, you should definitely do performance testing to be sure. For a typical HTTP-based WCF service, all requests will be initially handled by http.sys inside Windows, and then dispatched to the appropriate process. Whether or not your service is hosted in IIS or standalone will not matter nearly as much as the WCF-specific configuration settings you use, with respect to per-call, per-session or singleton configuration, and request size limits and request throttling.
I would focus on usability and what makes more sense than strictly on performance numbers, since they should be nearly the same.
Bottom line: use whatever is more convenient, performance test when necessary.