简体   繁体   中英

concurrent requests in REST service

I am seeking clarification for working with WCF rest services.

  1. How many concurrent request a REST service can handle?
  2. Does TimeOut have any dependency on this?
  3. How do we implement cache in REST for the connections it make;(For Eg. REST service is making a connection to a windows object , say Windows 8, to query something; How I can keep this connection in cache)?

It would be great, if you can provide some piece of information.

Thanks Sebastian

Given the broad nature of your question(s), I think you may need to look into a few aspects of WCF services:

Instancing
The instancing behavior (set by using the ServiceBehaviorAttribute.InstanceContextMode property) controls how the InstanceContext is created in response to incoming messages. By default, each InstanceContext is associated with one user-defined service object, so (in the default case) setting the InstanceContextMode property also controls the instancing of user-defined service objects.

Concurrency
Concurrency is the control of the number of threads active in an InstanceContext at any one time. This is controlled by using theServiceBehaviorAttribute.ConcurrencyMode with the ConcurrencyMode enumeration.

Throttling
The ServiceThrottlingBehavior class exposes properties that you can use to limit how many instances or sessions are created at the application level. Using this behavior, you can fine-tune the performance of your WCF application. Use the MaxConcurrentCalls property to specify the maximum number of messages actively processing across a ServiceHost class, and the MaxConcurrentInstances property to specify the maximum number of InstanceContext objects in the service.

The following links provide valuable reference:
http://msdn.microsoft.com/en-us/library/ms731193(v=vs.110).aspx
http://msdn.microsoft.com/en-us/library/ms735114(v=vs.110).aspx
Creating a WCF Restful service, concurrency issues

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM