Is there an optimal byte size for sending data over a network?

后端 未结 9 2085
既然无缘
既然无缘 2021-02-19 15:25

I assume 100 bytes is too small and can slow down larger file transfers with all of the writes, but something like 1MB seems like it may be too much. Does anyone have any sugge

9条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-19 16:08

    The one thing I will add is that for a given ethernet connection it takes about as long to send a small packet as a large one. As other's have said: if you're just sending a stream of data let the system handle it. But if you're worried about individual short messages back and forth, a typical ethernet packet is about 1500 bytes- as long as you keep it under that you should be good.

提交回复
热议问题