how TCP can be tuned for high-performance one-way transmission?

前端 未结 3 522
再見小時候
再見小時候 2021-02-11 04:21

my (network) client sends 50 to 100 KB data packets every 200ms to my server. there\'re up to 300 clients. Server sends nothing to client. Server (dedicated) and clients are in

3条回答
  •  遥遥无期
    2021-02-11 04:36

    Since all clients are in LAN, you might try enabling "jumbo frames" (need to run a netsh command for that, would need to google for the precise command, but there are plenty of how-tos).

    On the application layer, you could use TransmitFile, which is the Windows sendfile equivalent and which works very well under Windows Server 2003 (it is artificially rate-limited under "non server", but that won't be a problem for you). Note that you can use a memory mapped file if you generate the data on the fly.

    As for tuning parameters, increasing the send buffer will likely not give you any benefit, though increasing the receive buffer may help in some cases because it reduces the likelihood of packets being dropped if the receiving application does not handle the incoming data fast enough. A bigger TCP window size (registry setting) may help, as this allows the sender to send out more data before having to block until ACKs arrive.

    Yanking up the program's working set quota may be worth a consideration, it costs you nothing and may be an advantage, since the kernel needs to lock pages when sending them. Being allowed to have more pages locked might make things faster (or might not, but it won't hurt either, the defaults are ridiculously low anyway).

提交回复
热议问题