-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a socket pool of multiple sockets bound to the same port #293
Conversation
…reads without blocking.
For testing outside the maven contex.
Let the sockets themselves do the blocking, no need for extra synchronization.
1dde751
to
6182860
Compare
(And thus SinglePortUdpHarvester.)
requestedNumSockets | ||
} else { | ||
// TODO: set this to 1 in situations where pools aren't needed? | ||
2 * Runtime.getRuntime().availableProcessors() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest logging the number we end up using.
Why does it default to twice the number of processors? Running your test on an A2 with 8 CPUs I see optimal performance for 8 sockets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was testing on a 4-core machine, but if JVB is using an 8 core one your tests are probably more representative. (My tests were also pretty noisy; I suspect the host my lonely instance is on is pretty busy.)
So we can send from the same local IP and port from multiple threads simultaneously on Java 18+.