-
Notifications
You must be signed in to change notification settings - Fork 275
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
Add following configs for network tuning. #1247
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1247 +/- ##
============================================
+ Coverage 72.35% 72.38% +0.03%
- Complexity 6160 6164 +4
============================================
Files 444 444
Lines 35364 35400 +36
Branches 4491 4499 +8
============================================
+ Hits 25586 25624 +38
+ Misses 8602 8601 -1
+ Partials 1176 1175 -1
Continue to review full report at Codecov.
|
*/ | ||
@Config("router.max.put.chunk.number") | ||
@Default("4") | ||
public final int routerMaxPutChunkNumber; |
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 ended up adding this config in another PR, so you can remove this
VerifiableProperties vprops = new VerifiableProperties(props); | ||
NetworkConfig networkConfig = new NetworkConfig(vprops); | ||
this.selector = | ||
new Selector(new NetworkMetrics(new MetricRegistry()), SystemTime.getInstance(), null, networkConfig); |
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.
is there a way to test the new configs?
@@ -340,6 +346,10 @@ private void pollOnMainThread(long timeoutMs, List<NetworkSend> sends) throws IO | |||
metrics.selectorReadyKeyCount.inc(keys.size()); | |||
Iterator<SelectionKey> iter = keys.iterator(); | |||
while (iter.hasNext()) { | |||
if (networkConfig.selectorMaxRunningTimeInMs != -1 |
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.
It seems like one of these configs applies only for main thread polling and one applies for executor pool polling
Change handshake metric start time.
PR updated. Feel free to review. Working on a test per @cgtz 's comment, will push it soon. |
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.
Looks good. Two minor comments.
metrics.selectorIOCount.inc(); | ||
metrics.selectorIOTime.update(time.milliseconds() - endSelect); | ||
long selectorIOTime = time.milliseconds() - endSelect; | ||
if (selectorIOTime >= 50) { |
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.
We choose 50 here based on observation? Also, I feel like selectorIOTime
can be updated before checkUnreadyConnectionsStatus
.
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.
Yes, it's based on observation to filter out small selectorIOTime that we don't care about.
pollOnMainThread
also do the same thing for selectorIOTime
. Prefer not to change it now.
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.
checkUnreadyConnectionsStatus
is just some local computation. It should be a fast call.
@@ -66,6 +67,7 @@ | |||
private SSLFactory sslFactory; | |||
|
|||
public SocketServer(NetworkConfig config, SSLConfig sslConfig, MetricRegistry registry, ArrayList<Port> portList) { | |||
this.networkConfig = config; | |||
this.host = config.hostName; | |||
this.port = config.port; | |||
this.numProcessorThreads = config.numIoThreads; |
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.
selectorExecutorPoolSize
can be removed from this class.
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.
addressed.
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.
LGTM
@cgtz Good to merge this? |
routerConfig.routerMaxPutChunkNumber
networkConfig.selectorMaxRunningTimeInMs
networkConfig.selectorMaxKeyToProcess