在 C 中发送的推荐块大小? [英] recommended chunk size for sending in C?

查看:35
本文介绍了在 C 中发送的推荐块大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个服务器,它需要为每个请求传输大量数据(约 1-2 个演出).每次发送调用应具有的推荐数据量是多少?重要吗?

I have a server which needs to transfer a large amount of data (~1-2 gigs) per request. What is the recommended amount of data that each call to send should have? Does it matter?

推荐答案

TCP/IP 堆栈负责不发送大于 PATH MTU 的数据包,您必须非常努力地让它发送数据包 比 MTU 小,以无助于吞吐量的方式:并且无法发现任何给定连接的路径 PTU 实际上是什么.所以不要考虑路径MTU.

The TCP/IP stack takes care of not sending packets larger than the PATH MTU, and you would have to work rather hard to make it send packets smaller than the MTU, in ways that wouldn't help throughput: and there is no way of dsicovering what the path PTU actually is for any given connection. So leave all consideration of the path MTU out of it.

您可以而且应该使每个 send() 尽可能大.

You can and should make every send() as big as possible.

这篇关于在 C 中发送的推荐块大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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