Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Expensive are ???-Hosted WCF Services?

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.

like image 632
William Daniel Avatar asked Feb 16 '10 17:02

William Daniel


People also ask

How is WCF service hosted?

WCF services can be hosted in any managed application. This is the most flexible option because it requires the least infrastructure to deploy. You embed the code for the service inside the managed application code and then create and open an instance of the ServiceHost to make the service available.

What is the need for activation or hosting of a WCF service?

Hosting a WCF service in Windows Activation Service (WAS) is most advantageous because of its features such as process recycling, idle time management, common configuration system, and support for HTTP, TCP, etc.

What is self hosted WCF?

This is referred to as a self hosting WCF service, the exact meaning of Self Hosted is that it hosts the service in an application that could be a Console Application or Windows Forms and so on. Earlier we saw what a WCF Service is in the . Net environment. We can host a WCF service in IIS and a Windows service also.

Why should we use WCF service?

WCF lets you asynchronus messages transform one service endpoint to another. Windows Communication Foundation(WCF) supports multiple language & platforms. WCF Provides you a runtime environment for your services enabling you to expose CLR types as Services and to consume other Services as CLR Types.


1 Answers

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.

like image 68
Brad Nabholz Avatar answered Sep 27 '22 22:09

Brad Nabholz