WCF TCP 比 HTTP 快多少 [英] WCF How much faster is TCP than HTTP

查看:33
本文介绍了WCF TCP 比 HTTP 快多少的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 TCP 比 WCF 的 HTTP 快,但我很想知道快多少.我有一个使用 HTTP 的大型应用程序的性能问题,我正在考虑迁移到 netTcp 是否会产生足够的性能改进,使投资变得值得.

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.

有谁知道netTCP和Http绑定发送的数据量有什么区别?

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

推荐答案

到目前为止答案很多,但没有具体数据.

So far lots of answers but no concrete data.

Microsoft 制作了一个测试来准确地测量您所询问的内容 - WCF 服务的 HTTP 和 TCP 之间的性能(吞吐量)差异.(测试没有考虑数据包大小!)

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!)

这表明,对于此测试中的消息,TCP/二进制提供的吞吐量几乎是 HTTP/xml 的 2 倍.此测试的瓶颈是服务器 CPU,而不是网络.您的结果会有所不同,因为您的消息将更(或更少)复杂,您的网络将更多(或更少)受限,您的应用程序代码将更多(或更少)占用 CPU.但这给了你一个想法.

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.

实际上,Stocktrader 基准测试是一项具有竞争力的项目,将 Windows Server 上的 WCF 的性能与 Linux 上的 WebSphere 的性能进行比较.但作为其中的一部分,MS 还将使用 HTTP 的 WCF 的性能与使用 TCP 的 WCF 的性能进行了比较.

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.

下载完整的 Stocktrader报告

这篇关于WCF TCP 比 HTTP 快多少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆