0

I have a WCF service that is consumed by a website like SO. It is general QnA website that can be used by anyone around the World and so its WCF service. I tried WSHttpBinding, but it is lacking performance and my website is going down many times. I know it can be server issue, but I want to know if there is something else can be done at WCF configuration level. Not much but at least some performance can be increased.

Also, I am trying to switch to netTcpBinding, but I researched and found that netNamedPipeBinding is much better for performance. Please tell me which binding should I use for a website like SO?

Shiva Pareek
  • 1,719
  • 5
  • 21
  • 42
  • `NetTcpBinding` can only be used by .NET clients. `NetNamedPipeBinding` can only be used on the **same** machine. For maximum interoperability, you'll need to stick with an http binding. I would look into 1) throttling options for the service and 2) increasing the server's capabilities. I would expect that the server machine's resources would be the best place to get your improved performance. – Tim Mar 03 '14 at 15:38
  • @Tim if asp.net web forms website is the only client then `NetTcpBinding` will give better performance or `HttpBinding`? – Shiva Pareek Mar 03 '14 at 16:21
  • 1
    Yes, if the only client is .NET then `NetTcpBinding` should be somewhat faster. – Tim Mar 03 '14 at 17:03
  • Thanks @Tim. It cleared my confusion. Now if in future I have other types of clients, I will switch to `HttpBinding`. Add this as an answer, I will mark it. – Shiva Pareek Mar 03 '14 at 17:32
  • If you don't like wshttpbinding, you still have webhttpbinding and basicHttpBinding. I've used basichttpbinding without many problems ... it's fast and robust. – Brian Mar 03 '14 at 18:43
  • @Brian But I don't think it provides much security. – Shiva Pareek Mar 03 '14 at 18:55
  • @Brian - `basicHttpBinding` is SOAP 1.1 and has less security features than `wsHttpBinding` (which is SOAP 1.2). `webHttpBinding` is for RESTful WCF services which is an entirely different kind of web service. – Tim Mar 03 '14 at 19:45

1 Answers1

1

Since your client is .NET, NetTcp will generally give you the best performance, as "The WCF TCP transport is optimized for the scenario where both ends of the communication are using WCF. This binding is the fastest WCF binding for scenarios that involve communicating between different machines." See Choosing a Transport for more information on MSDN.

In that same article, TCP is one of the recommended transports when latency, reach, security, throughput and/or tooling are decision points in the design.

If your data repository is on the same machine as the web site (not a good design practice) you can use named pipes as well.

Also see this question and the answers/comments for some further information.

Community
  • 1
  • 1
Tim
  • 28,212
  • 8
  • 63
  • 76