TCP与Http基准 [英] TCP Vs. Http Benchmark

查看:102
本文介绍了TCP与Http基准的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用IIS上的Web应用程序,并与[remote] Service-Machine交谈。
我不确定是否选择TCP或Http作为主协议。

I am having a Web application sitting on IIS, and talking with [remote]Service-Machine. I am not sure whether to choose TCP or Http, as the main protocol.

更多详情:


  1. 我将有多个服务\ endpoint

  2. 其中一些将是单向的

  3. 另一个将是双向的

  4. 网页将在服务面前工作

  5. 我们正在讨论的是高规模网站

  1. i will have more than one service\endpoint
  2. some of them will be one-way
  3. the other will be two-ways
  4. the web pages will work infront of the services
  5. we are talking about hi-scale web-site

我非常了解差异,但我正在寻找一个好的基准测试,它显示TCP的速度有多快?

I know the difference pretty well, but I am looking for a good benchmark, that shows how much faster is the TCP?

推荐答案

HTTP是在TCP层上构建的一层,用于标准化数据传输。因此,使用TCP套接字自然会比使用HTTP更重。如果性能是您唯一关心的,那么普通的TCP是最适合您的解决方案。

HTTP is a layer built ontop of the TCP layer to some what standardize data transmission. So naturally using TCP sockets will be less heavy than using HTTP. If performance is the only thing you care about then plain TCP is the best solution for you.

您可能想要考虑HTTP,因为它易于使用且简单易用缩短开发时间。如果您正在做一些可能被浏览器直接使用的东西(通过AJAX调用),那么您应该使用HTTP。对于非现代浏览器直接使用没有HTTP的TCP连接,您必须使用Flash或Silverlight,这通常适用于视频和/或音频等丰富内容。但是,现在许多现代浏览器(截至2013年)都支持API直接通过JavaScript访问网络,音频和视频资源。唯一要考虑的是用户之间现代Web浏览器的使用率;有关浏览器兼容性的最新信息,请参见 caniuse.com

You may want to consider HTTP because of its ease of use and simplicity which ultimately reduces development time. If you are doing something that might be directly consumed by a browser (through an AJAX call) then you should use HTTP. For a non-modern browser to directly consume TCP connections without HTTP you would have to use Flash or Silverlight and this normally happens for rich content such as video and/or audio. However, many modern browsers now (as of 2013) support API's to access network, audio, and video resources directly via JavaScript. The only thing to consider is the usage rate of modern web browsers among your users; see caniuse.com for the latest info regarding browser compatibility.

至于基准测试,我发现这个。见第5页,它有性能图表。请注意,它并不真正比较苹果和苹果,因为它将TCP /二进制数据选项与HTTP / XML数据选项进行比较。这引出了一个问题:您的服务输出的是哪种数据?二进制(视频,音频,文件)或文本(JSON,XML,HTML)?

As for benchmarks, this is the only thing I found. See page 5, it has the performance graph. Note that it doesn't really compare apples to apples since it compares the TCP/Binary data option with the HTTP/XML data option. Which begs the question: what kind of data are your services outputting? binary (video, audio, files) or text (JSON, XML, HTML)?

一般来说,像军事或金融部门那样的绩效导向系统可能会使用普通的TCP连接。一般网络公司将选择使用HTTP并使用IIS或Apache来托管其服务。

In general performance oriented system like those in the military or financial sectors will probably use plain TCP connections. Where as general web focused companies will opt to use HTTP and use IIS or Apache to host their services.

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

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