R
Ron
My group at work has a tool, written in java, that receives and
displays UDP packets. We are experiencing a problem that packets are
missing when the message rate gets higher than 50/second.
To investigate further, I have two test programs running on a Windows
PC listening for those UDP packets. One is written in C, and the
other in java. All these programs do is count received packets and
then print out the current count every 1000 messages.
During my testing I increase the rate of UDP packets at the source.
The C program has no problems. Just as with the tool, the java test
program starts to miss packets after 50/second (50 is no problem, but
I start to see a problem at my next increment, which is 75/second).
In the java program, the DatagramSocket, DatagramPacket and the
counter are constructed once at initialization. Besides the call to
receive, the only thing that happens each time through the loop is the
check for counter % 1000 == 0, but I think that shouldn't be an issue.
In any case, the C program has no trouble.
Also: java -fullversion results in 1.6.0-b105 on my test platform (in
case you are wondering).
My questions:
- Is it reasonable to expect the java program to be able to
successfully receive more than 50 packets per second?
- If the answer to that is yes, what can I do to achieve better
performance?
I have not tried it on other platforms, but it is a bit of a moot
point because my team wants to be able to run their tool on a laptop
running windows.
displays UDP packets. We are experiencing a problem that packets are
missing when the message rate gets higher than 50/second.
To investigate further, I have two test programs running on a Windows
PC listening for those UDP packets. One is written in C, and the
other in java. All these programs do is count received packets and
then print out the current count every 1000 messages.
During my testing I increase the rate of UDP packets at the source.
The C program has no problems. Just as with the tool, the java test
program starts to miss packets after 50/second (50 is no problem, but
I start to see a problem at my next increment, which is 75/second).
In the java program, the DatagramSocket, DatagramPacket and the
counter are constructed once at initialization. Besides the call to
receive, the only thing that happens each time through the loop is the
check for counter % 1000 == 0, but I think that shouldn't be an issue.
In any case, the C program has no trouble.
Also: java -fullversion results in 1.6.0-b105 on my test platform (in
case you are wondering).
My questions:
- Is it reasonable to expect the java program to be able to
successfully receive more than 50 packets per second?
- If the answer to that is yes, what can I do to achieve better
performance?
I have not tried it on other platforms, but it is a bit of a moot
point because my team wants to be able to run their tool on a laptop
running windows.