0
votes

I have windows service developed in .Net Framework 4.5. This process (windows service) is hosting 3 different soap based WCF services. Each WCF service is running on different port but inside the same process (windows service). Many of the clients are consuming these 3 soap based WCF services for different purpose. This communication happens through https protocol in LAN environment. Clients communicate periodically (say for instance after every 15 or 30 seconds) to these WCF services. We call it as heartbeat mechanism. For each call to any method in the service, some amount of processing takes place on service side. This mechanism works fine for few hundred clients i.e. about 200 to 300 clients. But as no of client’s increases, many clients starts experience delay. I understand that this architecture is not enough capable to handle large no of request. But to improve the performance of the system, I have thought of following ways

  1. Isolation of the services for scalability and stability. One of the way is to host each WCF service into separate windows service. So there will be 3 different windows services each of it will have instance of WCF service. Deployment point of view this looks painful to me.
  2. Instead of self-hosting, host it in IIS. I think then IIS will manage the resources of service in optimized manner.

So question is

  1. Whether isolation of services into different windows services on the same machine will really improve the performance or not? I do not want these services to be deployed on more than one machine for load balancing. Doing it so will increase the cost to the customer (due to hardware, windows server licensing cost etc.). Due to this customer will loose the features such as high availability but that is fine if he/she is not willing to spend more.

  2. Whether IIS hosting will perform better than hosting in windows services?

  3. Will this mechanism i.e. isolation of service will improve the stability of the system.

1

1 Answers

0
votes

IIS hosting is the preferred method of hosting soap based wcf services, rule of thumb is to adhere to the following:

  1. Ensure your service is decorated with: [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple, InstanceContextMode = InstanceContextMode.PerCall)]. Or which ever instancing mode suits your scenario.

  2. Ensure that your client closes calls and disposes accordingly all the time you make the call.

  3. you might want to consider using the async calls to your service. emphasized text