Linux: Reduce UDP Packets Error

linux-networkingudp

I'm facing UDP packet receive errors (under Linux 'netstat -su' command).

I have 10 x UDP processes running on Machine-A (RHEL 5.2) and each of them send 290-byte packet at 50 times per second to the same address and same UDP port. On the recipient end (Machine-B RHEL5.2), I have a process that listens to this UDP port. Also, at Machine-B, I run 'netstat -su' to check for UDP packet errors.

I read that I need to configure my Machine-B Linux sysctl and I did the following for the above test:

   net.core.rmem_max = 33554432
   net.core.netdev_max_backlog = 2000

Also, I have changed my MTU size for both interfaces in Machine-A and Machine-B to 1380.

With all the above, I still encountered UDP packet receive errors increasing (under netstat)

How come? Anything else I need to configure?

By the way, I also tried net.core.rmem_max = 131071, but still facing packet receive errors 🙁

Best Answer

net.core.rmem_max is the maximum value that can be set. However, there is also a default value called net.core.rmem_default - I'd increase this one too.

Also you have to tune your application's buffer settings. Often people try to tune the kernel settings but not forget on application's ones.