Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF - what is the fastest binding?

Tags:

wcf

I currently have a WCF service which uses BasicHTTP binding, and is wrapped with a secure router/firewall (PFSense).

I have heard that there is a faster binding than BasicHTTP binding, but I do now know what it is.

Does anyone know?

Update: ok, two great answers for intranet/localhost. Thank you! What about for internet deployed apps? Is there a faster internet centric solution?

like image 969
pearcewg Avatar asked Nov 19 '11 02:11

pearcewg


2 Answers

If your solution is deployed to an intranet, you can use NetTcpBinding.

http://msdn.microsoft.com/en-us/library/system.servicemodel.nettcpbinding.aspx

While perhaps not authoratative, this post covers some benchmarking with these results, which are consistent with my answer and parapura's:

WSDualHttpBinding: Processed 1602 calls in 10 seconds
WSHttpBinding: Processed 2531 calls in 10 seconds
BasicHttpBinding: Processed 17913 calls in 10 seconds
NetTcpBinding: Processed 39957 calls in 10 seconds
NetNamedPipeBinding: Processed 48255 calls in 10 seconds
like image 80
Jay Avatar answered Nov 15 '22 22:11

Jay


On the same machine you can use NetNamedPipeBinding for maximum performance.

Decision Points for Choosing a Transport

Throughput measures the amount of data that can be transmitted and processed in a specified period of time. Like latency, the chosen transport can affect the throughput for service operations. Maximizing throughput for a transport requires minimizing both the overhead of transmitting content as well as minimizing the time spent waiting for message exchanges to complete. Both the TCP and named pipe transports add little overhead to the message body and support a native duplex shape that reduces the wait for message replies.

like image 9
parapura rajkumar Avatar answered Nov 15 '22 23:11

parapura rajkumar