Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF How much faster is TCP than HTTP

I understand that TCP is faster than HTTP for WCF but I'm interested to know by how much. I have a performance issue with a large application that uses HTTP and am considering whether moving to netTcp would yield a sufficient performance improvement to make the investment worthwhile.

Anyone know the difference in the amount of data sent by netTCP compared to Http bindings?

like image 759
Mark 909 Avatar asked Dec 23 '10 15:12

Mark 909


2 Answers

So far lots of answers but no concrete data.

Microsoft produced a test to measure exactly what you asked about - the performance (throughput) difference between HTTP and TCP for WCF services. (The test didn't consider packet size!)

Figure 1: Peak TPS Rates for the Web Service Test. IBM WebSphere Trade 6.1 is running in its default EJB/Entity Beans with Container Managed Persistence (CMP).

What this shows is that TCP/binary delivers nearly 2x the throughput of HTTP/xml, for the messages in this test. The bottleneck on this test was Server CPU, not network. Your results will vary because your messages will be more (or less) complex, your network will be more (or less) constrained, and your app code will be more (or less) CPU-intensive. But this gives you an idea.

Actually the Stocktrader benchmark was a competitive thing, comparing the performance of WCF on Windows Server to that of WebSphere on Linux. But as part of that, MS also compared the performance of WCF using HTTP to the performance of WCF using TCP.

download the full Stocktrader report

like image 180
Cheeso Avatar answered Nov 15 '22 12:11

Cheeso


Its not quite that simple. HTTP, TCP and other transport options have options to balance outside of just speed. Reliability can play a major role in the stability of your application depending on what it actually does. Don't just flip the protocol and run your program a couple times and consider that a good test. Read about the protocols and weigh the options against your requirements. Run some program, load, performance and network tests, preferably with the help of a qualified network admin.

Update: Since you changed your question I should also note that you need to figure out what is causing the performance loss rather than poking about measuring theoretical packet size. Like everybody else is saying, run tests.

like image 5
P.Brian.Mackey Avatar answered Nov 15 '22 14:11

P.Brian.Mackey