• UDP VS TCP 规格严格


    Mostly buffer space. Say you're sending a constant 10MB/second , and you're only able to consume 5MB/second, the OS and network stack can't keep up, so it will drop the packets - this should be rather obvious. (Which, naturally is different from TCP which provides flow control and retransmission to handle such a situation).

    Even if you're normally keeping up with consuming the data, there might be small time slices where you're not. e.g. a garbage collector kicks in, the OS decided to schedule another process instead of your consumer for 0.5 seconds, etc - and the system will drop packets.

    This can be extended to any network devices in between. If you're running on a network instead of just locally, an ethernet switch, router, etc. will also drop packets if its queues are full (e.g. you're sending a 10MB/s stream through an 100MB/s ethernet switch, and a few seconds in the middle of the night someone else tries to cram 100MB/sec through the same path, some packets will lose.)

    Try increasing the socket buffers size, often you have to increase this on the OS level as well.

    (e.g. on linux, the default socket buffer size is often only 128k or less, which leaves very little room for pausing the data processing , you can try to increase them by setting the sysctl net.core.wmem_max,net.core.wmem_default, net.core.rmem_max, net.core.rmem_default)

    http://stackoverflow.com/questions/47903/udp-vs-tcp-how-much-faster-is-it

    http://stackoverflow.com/questions/11994086/receiving-real-time-gps-data-via-udp
     

  • 相关阅读:
    Mac 安装 Python3
    在push的时候发生崩溃信息
    Swift3.0 和 Swift3.0.2的区别
    01- 简单值
    @objc || private || 按钮的点击事件
    extension的作用
    swift3.0中使用代码添加选中图片
    OC-创建瀑布流
    springboot项目控制台日志不是彩色的原因
    更改docker里mysql的字符编码
  • 原文地址:https://www.cnblogs.com/diyunpeng/p/2687362.html
Copyright © 2020-2023  润新知