NamedPipe 与 TCP/IP 在小数据中的比较

发布于 2024-10-10 08:14:17 字数 84 浏览 0 评论 0原文


如果我们向客户端/服务器来回传递少量数据,tcp/ip 的开销可以忽略不计,并且性能与同一台计算机上的 NamedPipe 相同,这是真的吗?

Hi
Is It true that if we pass little data back and forth to client/server the overhead of tcp/ip is negligible and performance is the same as NamedPipe on the same machine ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

始终不够爱げ你 2024-10-17 08:14:17

我想说,与其说是数据量,不如说是请求数量。换句话说,如果您有 100,000 个连接传递 100 字节的数据,那么您将比拥有 10 个每个 100K 的连接有更多的 tcp/ip 开销。

这并不是说通过 tcp/ip 与命名管道传输数据没有相关的开销。有。但通常我会说,您要使用哪一种的决定更多地取决于系统的架构,而不是关心开销。

如果你要在物理服务器之间传输数据,你必须使用tcp/ip;命名管道不是一个选项。如果您在同一服务器上的进程之间传输数据,命名管道显然性能更好。

当您位于同一台物理服务器上时,您可能想要使用 tcp/ip 的原因之一是,如果您将来有可能将进程中断到物理服务器上。

回答您的问题:如果您不传递大量数据,并且不经常这样做,那么当两个端点位于同一台物理计算机上时,您可能不会注意到 tcp/ip 开销。

HTH,
詹姆斯

I'd say it's not so much the quantity of data as much as it is the number of requests. In other words, if you have 100,000 connections that pass 100 bytes of data, you're going to have more tcp/ip overhead than if you have 10 connections of 100K each.

That's not to say that there isn't overhead associated with transferring the data via tcp/ip vs. named pipes. There is. But usually I'd say the decision of which one you're going to use has to do more with the architecture of your system than concern about the overhead.

If you're going to transfer data between physical servers, you have to go with tcp/ip; named pipes aren't an option. If you're transferring data between processes on the same server, named pipes are clearly the better performer.

One reason you might want to go with tcp/ip when you're on the same physical server is if there's a chance that you'll break the processes onto physical servers at some point in the future.

To answer your question: If you're not passing a lot of data, and you're not doing it frequently, you're probably not going to notice the tcp/ip overhead when the two endpoints are on the same physical machine.

HTH,
James

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文