Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UDP receive queue full?

Tags:

linux

udp

I have an application that receives heavy UDP traffic on port 12201 and I have noticed that some of the UDP packets never make into the application (received by kernel only).

When I run

netstat -c --udp -an | grep 12201

I can see that Recv-Q is almost always 126408, rarely going below, never going above:

Proto Recv-Q Send-Q Local Address Foreign Address State
udp 126408 0 :::12201 :::*
udp 126408 0 :::12201 :::*
udp 126408 0 :::12201 :::*
udp 126408 0 :::12201 :::*
udp 126408 0 :::12201 :::*
udp 126408 0 :::12201 :::*
udp 126408 0 :::12201 :::*
udp 126408 0 :::12201 :::*
udp 126408 0 :::12201 :::*
udp 126408 0 :::12201 :::*
udp 126408 0 :::12201 :::*
udp 126408 0 :::12201 :::*
udp 126408 0 :::12201 :::*
udp 126408 0 :::12201 :::*
udp 126408 0 :::12201 :::*
udp 126408 0 :::12201 :::*
udp 126408 0 :::12201 :::*

Does this mean that receive queue is full? Where does number 126408 come from? How can I increase it?

Sysctl config:

# sysctl -a | grep mem
vm.overcommit_memory = 0
vm.nr_hugepages_mempolicy = 0
vm.lowmem_reserve_ratio = 256   256     32
vm.meminfo_legacy_layout = 1
vm.memory_failure_early_kill = 0
vm.memory_failure_recovery = 1
net.core.wmem_max = 124928
net.core.rmem_max = 33554432
net.core.wmem_default = 124928
net.core.rmem_default = 124928
net.core.optmem_max = 20480
net.ipv4.igmp_max_memberships = 20
net.ipv4.tcp_mem = 365760       487680  731520
net.ipv4.tcp_wmem = 4096        16384   4194304
net.ipv4.tcp_rmem = 4096        87380   4194304
net.ipv4.udp_mem = 262144       327680  393216
net.ipv4.udp_rmem_min = 4096
net.ipv4.udp_wmem_min = 4096
like image 873
Iokanaan Iokan Avatar asked Sep 28 '22 14:09

Iokanaan Iokan


1 Answers

Looks like your application using system default receive buffer, which is defined via sysctl

net.core.rmem_default = 124928

Hence you see upper limit in Recv-Q close to above. Try changing SO_RCVBUF socket option in you application to higher values, probably up to max limit. As defined in sysctl setting net.core.rmem_max = 33554432

Dropped packet count due to queue full, can be seen via netstat -us (look for packet receive errors)

like image 53
VenkatC Avatar answered Nov 15 '22 09:11

VenkatC