zoukankan      html  css  js  c++  java
  • 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
     

  • 相关阅读:
    VMware 创建的虚拟机,Xshell无法进行连接
    Centos7 文件修改详情
    Centos7 selinux关闭
    centos7 RPM命令使用
    centos 操作系统优化
    centos 内存使用情况+负载使用情况
    Centos 修改环境变量
    centos7 系统级别(持续更新)
    centos7 常规修改信息(比较杂的)持续更新
    centos7 修改网卡信息
  • 原文地址:https://www.cnblogs.com/diyunpeng/p/2687362.html
Copyright © 2011-2022 走看看