WCF simple performance increasing techniques.

WCF simple performance increasing techniques.
Many times this recommendation listed below are not part of WCF suggested improving performance; and in my personal experience they make a considerable impact in the performance of WCF calls. You will primarily see the difference when you go live where you are dealing the full load on the application service calls.
1. Disable sessions on bindings.
a. Default Setting is enable session on service contracts which slows down the process.
b. Change it to on public interface. This does not enable session on the Service’s contract unless the client asks it to.
2. Force client-side WCF proxy classes to call .Close() when successful, and .Abort() when errors are encountered. This will significantly improve the performance since you won’t leave active connections in the server. (Note; WCF expects application to manage the number of maximum connection)
3. Set InstanceContextMode to Single and ConcurrencyMode to Multiple in Service implementations, then focus on the MaxConcurrentCalls value in configuraiton to get the right amount of support for the number of inbound calls from consumers.
Decorate Service implementation code as follows to achieve this:
_

No comments: