sockets - Linux UDP max size of receive buffer -


what's maximum size of linux udp receive buffer? thought it's limited available ram, when set

5gb rmem_max:

echo 5000000000 > /proc/sys/net/core/rmem_max 

and 4gb actual socket buffer (in erlang):

gen_udp:listen(port, [{recbuf, 4000000000}]) 

when measure buffer utilization, shows:

# netstat -u6anp | grep 5050 udp6  1409995136      0 :::5050  :::*       13483/beam.smp 

i can't exceed 1.4gb. smaller buffer sizes, e.g. 500mb, actual buffer size matched configured value. system debian 6.0, machine has 50gb ram available.

it seems there limit in linux. have tried setting rmem_max 2^32-1 success.

   root@xxx:/proc/sys/net/core# echo 2147483647 > rmem_max    root@xxx:/proc/sys/net/core# cat rmem_max    2147483647 

2^32 much:

   root@xxx:/proc/sys/net/core# echo 2147483648 > rmem_max    root@xxx:/proc/sys/net/core# cat rmem_max    -18446744071562067968 

setting 5000000000 yields:

   root@xxx:/proc/sys/net/core# echo 5000000000 > rmem_max    root@xxx:/proc/sys/net/core# cat rmem_max    705032704 

i have tested in python setting , getting socket receive buffer with

   ss.setsockopt(socket.sol_socket, socket.so_rcvbuf, buffersize)    print ss.getsockopt(socket.sol_socket, socket.so_rcvbuf) 

if 'buffersize' less 1024^3 program prints doubled 'buffersize', otherwise falls 256.

the value 705032704*2 = 1410065408 close 1409995136 obtained netstat.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -