Few months back, we did some measurement of different WCF channel to get the precise idea about the performance in the different channel stack.
Following is the definition of the environment:
WCF service and client is hosted in the same Windows 2003 Server.
537 Users exist in the system.
WCF service is hosted in Windows Service.
System.Diagnostics.Stopwatch is used to measure time elapsed in Millisecond.
Two user credentials are used: one domain user & the local system account on which the server was running.
Primary goal was to measure the time required for each GetUsers() call( in milliseconds) for combination Binding and InstanceContextMode. That’s why, we took average of 10 Test Run (in different scenario) for each combination where in each Test Run, we call the GetUsers() 100×10 Times . Here comes the result:
From the graph above, it’s quite obvious that NetTcpBinding(PerSession) is the best performer, which is quite expected as per its channel behavior. Interestingly, if we look at the WsHttpBinding(PerSession), it is taking more time than session unaware BasicHttpBinding. There is a similarity in the trend of BasicHttpBinding (PerCall by default) , WsHttpBinding(PerCall) and NetTcpBinding(PerCall) in the first TestRun; as the first GetUsers() is setting up the whole channel stack, its taking more time than its usual time. On the other hand, WsHttpBinding(PerSession), and NetTcpBinding(PerSession) are more consistent in every Test Run because of the reusability of the Session. We measure that 15ms is the time taken on average to create a new Application specific session in our system.
Following is the Chart of the average time taken per request in milliseconds for each combination:
I would recommend you to visit Wcf Binding Comparision List and Supported Features (Reference)
for a quick comparison of different channel in terms of Transport Protocol, Message Encoding, and Message Versioning and so on.
Hope it helps to you to choose the right channel stack for your application.