Linux UDP max size of receive buffer

后端 未结 2 1072
梦如初夏
梦如初夏 2021-02-03 11:13

What\'s the maximum size of Linux UDP receive buffer? I thought it\'s limited only by available RAM, but when I set

5GB for rmem_max:

echo 5000000000 >         


        
2条回答
  •  梦毁少年i
    2021-02-03 11:44

    2^32-1 (2147483647, maximum 32bit signed integer)

    root@root@localhost:~# sysctl -w net.core.rmem_max=2147483647
    net.core.rmem_max = 2147483647
    
    root@localhost:~# sysctl -w net.core.rmem_max=2147483648
    sysctl: setting key "net.core.rmem_max": Invalid argument
    net.core.rmem_max = 2147483648
    

    Echoing into the /proc filesystem appears to overflow when attempting to set larger values.

提交回复
热议问题