-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HDFS-17254. DataNode httpServer has too many worker threads #6307
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
Conversation
|
💔 -1 overall
This message was automatically generated. |
|
LGTM. |
| "dfs.datanode.http.internal-proxy.port"; | ||
| public static final String DFS_DATANODE_NETTY_WORKER_NUM_THREADS_KEY = | ||
| "dfs.datanode.netty.worker.threads"; | ||
| public static final int DFS_DATANODE_NETTY_WORKER_NUM_THREADS_DEFAULT = 0; |
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.
Thanks for your contribution, but is it reasonable to default to 0 for the number of threads?
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.
@slfan1989 Thank you for your review, the default value should not continue to be 0, and I plan to change the default value to 10. What do you think, sir?
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.
@slfan1989 I have changed the default value to 10, and it works normally in our HDFS cluster.
|
@2005hithlj Thanks. Is it caused by enable webhdfs or http UI or some other reasons? |
|
@Hexiaoqiao sir. Thank you for your review, it caused by enable http UI. |
1888454 to
d911ba9
Compare
|
💔 -1 overall
This message was automatically generated. |
|
@2005hithlj Thanks for your contribution. Please also update hdfs-default.xml for the additional config item. |
|
💔 -1 overall
This message was automatically generated. |
|
@Hexiaoqiao OK Sir, I have already fixed and committed it. |
| import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_HTTP_ADDRESS_KEY; | ||
| import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_HTTP_INTERNAL_PROXY_PORT; | ||
| import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_NETTY_WORKER_NUM_THREADS_KEY; | ||
| import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_NETTY_WORKER_NUM_THREADS_DEFAULT; |
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.
Please add this configuration into hdfs-default.xml. Thanks.
| this.workerGroup = new NioEventLoopGroup(); | ||
| int workerThreads = conf.getInt(DFS_DATANODE_NETTY_WORKER_NUM_THREADS_KEY, | ||
| DFS_DATANODE_NETTY_WORKER_NUM_THREADS_DEFAULT); | ||
| this.workerGroup = new NioEventLoopGroup(workerThreads); |
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.
Better to use a cached thread pool here. this.workerGroup = new NioEventLoopGroup(workerCount, Executors.newCachedThreadPool()).
|
|
||
| <property> | ||
| <name>dfs.datanode.netty.worker.threads</name> | ||
| <value>10</value> |
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.
Shouldn't the default be 0, to preserve the original behaviour, earlier we were passing 0 internally here?
this.workerGroup = new NioEventLoopGroup();
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.
0 is probably not a good default value to use here. I think that is exactly why the author wanted to make it configurable. I don't think there is a strong need to preserve an not-ideal old behavior here.
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.
Changing defaults is an incompatible change, it should stay the same. the code is there since 2014, if someone finds it isn't a good number he can configure explicitly
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 don't have a strong opinion here. Either way works for me.
| int workerThreads = conf.getInt(DFS_DATANODE_NETTY_WORKER_NUM_THREADS_KEY, | ||
| DFS_DATANODE_NETTY_WORKER_NUM_THREADS_DEFAULT); |
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.
Should validate this value, for -ve values, if it is -ve we should put a warn log & use default.
|
💔 -1 overall
This message was automatically generated. |
| "dfs.datanode.http.internal-proxy.port"; | ||
| public static final String DFS_DATANODE_NETTY_WORKER_NUM_THREADS_KEY = | ||
| "dfs.datanode.netty.worker.threads"; | ||
| public static final int DFS_DATANODE_NETTY_WORKER_NUM_THREADS_DEFAULT = 10; |
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 needs to be changed as well
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.
@ayushtkn Thank you for your review, I have changed it.
|
💔 -1 overall
This message was automatically generated. |
|
@slfan1989 @xinglin @Hexiaoqiao Are there any other suggestions for this PR? |
|
lots of unit test failures. Maybe could you create an empty commit and push it to trigger a new build?
|
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
28e38df to
da066dc
Compare
e4739a5 to
dd79100
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. |
|
Hi @2005hithlj , Please check the failed unit tests if related to this PR first. |
ayushtkn
left a comment
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.
Minor comment, rest LGTM
| LOG.warn("The value of " + | ||
| DFS_DATANODE_NETTY_WORKER_NUM_THREADS_KEY + " is less than 0, will use default value: " + | ||
| DFS_DATANODE_NETTY_WORKER_NUM_THREADS_DEFAULT); | ||
| workerCount = DFS_DATANODE_NETTY_WORKER_NUM_THREADS_DEFAULT; |
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.
Use logger format {} instead of concat
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.
@ayushtkn Thanks for your review. I have revised it. could you take a look? Thanks.
|
💔 -1 overall
This message was automatically generated. |
|
We're closing this stale PR because it has been open for 100 days with no activity. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable. |
JIRA: HDFS-17254. DataNode httpServer has too many worker threads