Last post Sep 15, 2014 04:25 AM by Shawn - MSFT
Sep 11, 2014 07:03 AM|developer6603|LINK
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?
Sep 15, 2014 04:25 AM|Shawn - MSFT|LINK
If you’ve set your service to use PerCall or PerSession instance context mode and upped the throttling settings, but are still not getting the response times you’re looking for, then it’s worth investigating whether the calls
are being queued because there is not enough IO threads in the
ThreadPool to handle the requests.
You can establish whether or not the requests are actually taking longer to process under load (as opposed to being queued at a service level) either by profiling locally or using some form of run-time logging (I wrote a
LogExecutionTime attribute which might come in handy). If the calls aren’t taking longer to process and you’re not seeing very high
CPU utilisation then the increase in response time is likely a result of the request being queued whilst
WCF waits for a new IO thread to be made available to handle the request.
WCF uses the IO threads from the
ThreadPool to handle requests and by default, the ThreadPool keeps one
IO thread around for each CPU. So on a single core machine that means you only have
ONE available IO thread to start with, and when more
IO threads are needed they’re created by the ThreadPool
with a delay
For more detailed information, you could refer to: