Is WCF Durable Services the right choice?
We are in the process of sel开发者_运维技巧ecting the best method for saving state between WCF sessions/calls. We have found that WCF DurableService suits our needs.
We would like to know is this ok for heavy usage. We are expecting 1000+ sessions and each session will be persisting about 100KB of data (xml serialized format), with complex object (only 1 object) to be persisted.
Given our requirements, is WCF DurableServices the right solution?
DurableService uses built-in WCF features to communicate the state (module-level variables) to the client using either the BasicHttpContextBinding or the WSHttpContextBinding. The persistence mechanism depends on either HTTP cookies on the client or soap headers for storing the serialized data between calls. Your average soap message size would be 100KB plus whatever payload the operation parameters hold on each call. You also have to design CanCreateInstance and CompleteInstance semantics into your operations contracts and application logic to properly remove the session payload.
DurableService most likely isn't going to be very performant given your scenario of 1000+ concurrent session and 100KB of session data. By default, WCF services that enable session of any kind are limited to 16 concurrent sessions. You can increase that number but I doubt you'll be able to handle 1000+ sessions on a single server instance. For that many sessions you'll likely need to use either a hardware or software based load balancer for multiple host servers which makes maintaining session iffy in production even with so-called session affinity support. I'd recommend using a stateless per call service design and make the application code responsible for managing state.
精彩评论