I receive ~ 3000 UDP packets per second, each of which is ~ 200 bytes in size. I wrote a Java application that listens on these UDP packets and simply writes data to a file. The server then sends 15,000 messages at the previously specified rate. After writing to a file, there are ~ 3500 messages in total. Using wirehark, I confirmed that all 15,000 messages were received by my network interface. After that, I tried changing the size of the socket buffer (which was originally 8496 bytes):
(java.net.MulticastSocket)socket.setReceiveBufferSize(32*1024);
This change increased the number of messages stored to ~ 8000. I continued to increase the buffer size to 1 MB. After that, the number of saved messages reached ~ 14400. Increasing the buffer size to large values will not lead to an increase in the number of saved messages. I think I have reached the maximum allowed buffer size. However, I need to capture all 15,000 messages that were received by my network interface.
Any help would be greatly appreciated. Thanks in advance.
source
share