locked
WCF Service Instancing Behavior (Per Call, Per Session) RRS feed

  • Question

  • User-2066177896 posted

    Hi,

    We have a WCF Service hosted in a Windows Service. This Service is consumed by a Web application of ours.

    Client A, Client B, Client C, Client D will access this service through our asp.net application.

    I have questions about the instancing behavior.

    PerCall: would the requests be queued? or would they execute simultaneously? (our WCF Service runs for atleast 3 minutes.)

    If Client A calls the service 3-4 times within a short time frame, would they be queued and executed one after another?(In this scenario, we would prefer the requests be queued).

    PerSession: would the requests be queued? or would they execute simultaneously? (our WCF Service runs for atleast 3 minutes.)

    If Client A calls the service 3-4 times within a short time frame, would they be queued and executed one after another?(In this scenario, we would prefer the requests be queued).

    Thanks

    Friday, October 18, 2013 4:36 PM

Answers

  • User-742633084 posted

    Hi rowter,

    Instancing behavior determines how WCF service runtime will create WCF service class object to handle client request. And it will impact server-side concurrency behaivor only when you have WCF throttling setting restriction (which set max instance count to a low value). You can take a look at the following articles to get more ideas on throttling:

    • #WCF Throttling
      http://www.codeproject.com/Articles/33362/WCF-Throttling
    • #WCF Request Throttling and Server Scalability
      http://blogs.msdn.com/b/wenlong/archive/2008/04/21/wcf-request-throttling-and-server-scalability.aspx

    If max instance count is set to large enough value, then it won't cause rquest to be queued. And whether the request will be queued probably determined by if the WCF service runtime has enough thread pool thread to handle the request. WCF service use .NET thread pool thread to process request (so long running thread will occupy a certain threadpool thread for long time).

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, October 21, 2013 4:59 AM