none
WCF service hosted in windows service - Performance issue RRS feed

  • Question

  • From a website I am calling this WCF services which is hosted in Windows service environment. If multiple calls are made to this service concurrently from the website, Will it cause any performance issue?

    In my case all the logged in users in the website can call the WCF service which is hosted in windows service. And the WCF service is a long running task.

    I hope the service will by default use thread from the thread pool to handle each request (request to the service from website) if it defined as "For PerCall services". But my doubt is since it is a long running task (hours to finish), will it cause thread pool starvation when multiple user request for the service?

    Thanks

    Saturday, September 13, 2014 8:38 AM

Answers

  • <correction>

    So no, you shouldn't be using WCF services for long running tasks sucking up resources on the machine in the manner you are talking about.

    Monday, September 15, 2014 2:55 PM

All replies

  • WCF service is a multi treaded solution. The default setting for a WCF service is 5 concurrent connections, which can be taken higher. If you take the concurrent connection to a higher level, then it should be based on how many concurrent connections the O/S is going to allow for the machine that is hosting the service. 

    As long as you are opening connections to the service and closing them properly on the client side, so what if the service is being hosted by a Windows service? The service is only active within the Windows service when the client makes the request and the service gives the response. And once the response is give by the service, the connection should be closed that releases in resources used by the client and service on that particular thread.

    Sunday, September 14, 2014 10:03 PM
  • Thanks for your reply. But my concern is since the task are long running, will that cause any thread starvation issue? Also when threads are not available, the request which are in queue will time out after a particular time period? As I said my tasks(each user request) will take 6- 7 hours to finish. Should I manually handle number of concurrent request here? And rest in waiting list?

    Thanks.



    Monday, September 15, 2014 3:52 AM
  • Thanks for your reply. But my concern is since the task are long running, will that cause any thread starvation issue? Also when threads are not available, the request which are in queue will time out after a particular time period? As I said my tasks(each user request) will take 6- 7 hours to finish. Should I manually handle number of concurrent request here? And rest in waiting list?

    You shouldn't be using WCF for this. WCF is about SOA, Service Oriented Architecture, using a request and response patteren.  The service gets a request, it processes the request, and the service returns a response. The SOA service is short lived, it's not around long and it's in and get out quickly, and the service is avaliable for the next client request. So no, you should be using WCF services for long running tasks sucking up resources on the machine in the manner you are talking about.

    Monday, September 15, 2014 2:53 PM
  • <correction>

    So no, you shouldn't be using WCF services for long running tasks sucking up resources on the machine in the manner you are talking about.

    Monday, September 15, 2014 2:55 PM