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
HBASE-23113: Improve and add additional Netty configuration for RPC. #1440
Conversation
🎊 +1 overall
This message was automatically generated. |
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.
Patch looks good. Just adding extra configurable params w/ sensible looking defaults. Is the server tcp queue count low though?
"hbase.ipc.server.bufferhighwatermark"; | ||
|
||
protected static final boolean DEFAULT_SERVER_REUSEADDR = true; | ||
protected static final int DEFAULT_SERVER_TCP_BACKLOG = 1024; |
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.
Low for a server?
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.
Yeah, this lower end is much lower than the default.
private static final int DEFAULT_LOW_WATER_MARK = 32 * 1024;
private static final int DEFAULT_HIGH_WATER_MARK = 64 * 1024;
public static final WriteBufferWaterMark DEFAULT =
new WriteBufferWaterMark(DEFAULT_LOW_WATER_MARK, DEFAULT_HIGH_WATER_MARK, false);
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.
The TCP_BACKLOG? I think the linux default is often 128 as mentioned in the JIRA? Raising it too high is also often a mistake, so I went with what the original author did. Have another suggestion?
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.
For the WATER_MARK settings, the previous pr is using:
protected static final int DEFAULT_SERVER_BUFFER_LOW_WATERMARK = 1024;
protected static final int DEFAULT_SERVER_BUFFER_HIGH_WATERMARK = 64 * 1024;
If the number of queued bytes goes above the high mark, then channel.isWritable will return false until the number of outstanding bytes falls below the low water mark.
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.
The TCP_BACKLOG?
Sorry, no. I had this on the wrong line. I mean DEFAULT_SERVER_BUFFER_LOW_WATERMARK = 1024
.
If the number of queued bytes goes above the high mark, then channel.isWritable will return false until the number of outstanding bytes falls below the low water mark.
Right. So I'm asking you (and I guess @SteNicholas as well): why do we need to flush out the buffer down almost completely before we continue receiving data? Is this assuming that HBase clients are generally writing large amounts of data, and this to avoid thrashing back and forth between threads as we fill, flush, fill, flush? A setting this low means we'd have to drain the buffer almost entirely before returning to the user thread.
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.
@ndimiduk This could improve performance.
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
@@ -45,24 +46,45 @@ | |||
@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.CONFIG) | |||
public class NettyRpcClient extends AbstractRpcClient<NettyRpcConnection> { | |||
|
|||
protected final WriteBufferWaterMark writeBufferWaterMark; | |||
|
|||
protected static final String CLIENT_CONNECT_MAX_RETRIES = "hbase.ipc.client.connect.max.retries"; |
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.
These first three are unused. Any anyway, the parent class manages reading these values from configuration.
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.
Copy paste error, should just be WATERMARK stuff.
@@ -258,6 +252,8 @@ private void connect() { | |||
.option(ChannelOption.SO_KEEPALIVE, rpcClient.tcpKeepAlive) | |||
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, rpcClient.connectTO) | |||
.handler(new BufferCallBeforeInitHandler()).localAddress(rpcClient.localAddr) | |||
.option(ChannelOption.WRITE_BUFFER_WATER_MARK, | |||
((NettyRpcClient) rpcClient).writeBufferWaterMark) |
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.
This cast is redundant.
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.
Good catch, no longer necessary, from an earlier iteration.
private static final int EVENTLOOP_THREADCOUNT_DEFAULT = 0; | ||
|
||
protected static final String SERVER_TCP_BACKLOG = "hbase.ipc.server.tcpbacklog"; | ||
protected static final String SERVER_TCP_REUSEADDR = "hbase.ipc.server.tcpreuseaddr"; | ||
protected static final String SERVER_TCP_NODELAY = "hbase.ipc.server.tcpnodelay"; |
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.
NODELAY
and KEEPALIVE
are unused. Also managed by the parent 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.
Same copy paste mistake as above - previous PR had this all in the base class.
"hbase.ipc.server.bufferhighwatermark"; | ||
|
||
protected static final boolean DEFAULT_SERVER_REUSEADDR = true; | ||
protected static final int DEFAULT_SERVER_TCP_BACKLOG = 1024; |
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.
Yeah, this lower end is much lower than the default.
private static final int DEFAULT_LOW_WATER_MARK = 32 * 1024;
private static final int DEFAULT_HIGH_WATER_MARK = 64 * 1024;
public static final WriteBufferWaterMark DEFAULT =
new WriteBufferWaterMark(DEFAULT_LOW_WATER_MARK, DEFAULT_HIGH_WATER_MARK, false);
Looks like this one supersedes #679 . |
355d8fe
to
764fc6f
Compare
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
Thanks, that took the settings as given in the original pr for master it looks. |
Let's get the change to expose these configs into branch-2.3. We'll leave the default settings as they are until we have some proof that new defaults are doing some good. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
Failures look related. Complaint about netty on construction of RegionServer. |
💔 -1 overall
This message was automatically generated. |
@markrmiller you see the comment above? |
I'll take a look and update this in a bit. |
@markrmiller Any progress here boss? |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
Abandoned PR |
No description provided.