Skip to content

Commit

Permalink
HDDS-11225. Increase ipc.server.read.threadpool.size (#7007)
Browse files Browse the repository at this point in the history
  • Loading branch information
jojochuang authored Aug 2, 2024
1 parent 97bc6be commit c77115a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
9 changes: 9 additions & 0 deletions hadoop-hdds/common/src/main/resources/ozone-default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,15 @@
The number of RPC handler threads for OM service endpoints.
</description>
</property>
<property>
<name>ozone.om.read.threadpool</name>
<value>10</value>
<tag>OM, PERFORMANCE</tag>
<description>
The number of threads in RPC server reading from the socket for OM service endpoints.
This config overrides Hadoop configuration "ipc.server.read.threadpool.size" for Ozone Manager.
</description>
</property>
<property>
<name>ozone.om.http-address</name>
<value>0.0.0.0:9874</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ private OMConfigKeys() {
public static final String OZONE_OM_HANDLER_COUNT_KEY =
"ozone.om.handler.count.key";
public static final int OZONE_OM_HANDLER_COUNT_DEFAULT = 100;
public static final String OZONE_OM_READ_THREADPOOL_KEY =
"ozone.om.read.threadpool";
public static final int OZONE_OM_READ_THREADPOOL_DEFAULT = 10;

public static final String OZONE_OM_INTERNAL_SERVICE_ID =
"ozone.om.internal.service.id";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_KERBEROS_PRINCIPAL_KEY;
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_METRICS_SAVE_INTERVAL;
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_METRICS_SAVE_INTERVAL_DEFAULT;
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_READ_THREADPOOL_DEFAULT;
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_READ_THREADPOOL_KEY;
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_S3_GPRC_SERVER_ENABLED;
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_S3_GRPC_SERVER_ENABLED_DEFAULT;
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_NAMESPACE_STRICT_S3;
Expand Down Expand Up @@ -1241,8 +1243,6 @@ private RPC.Server getRpcServer(OzoneConfiguration conf) throws IOException {
OzoneNetUtils.getAddressWithHostNameLocal(omNodeRpcAddr);
}

final int handlerCount = conf.getInt(OZONE_OM_HANDLER_COUNT_KEY,
OZONE_OM_HANDLER_COUNT_DEFAULT);
RPC.setProtocolEngine(configuration, OzoneManagerProtocolPB.class,
ProtobufRpcEngine.class);

Expand Down Expand Up @@ -1271,8 +1271,8 @@ private RPC.Server getRpcServer(OzoneConfiguration conf) throws IOException {
ReconfigureProtocolService.newReflectiveBlockingService(
reconfigureServerProtocol);

return startRpcServer(configuration, omNodeRpcAddr, omService,
omInterService, omAdminService, reconfigureService, handlerCount);
return startRpcServer(conf, omNodeRpcAddr, omService,
omInterService, omAdminService, reconfigureService);
}

/**
Expand All @@ -1285,24 +1285,28 @@ private RPC.Server getRpcServer(OzoneConfiguration conf) throws IOException {
* (OMInterServiceProtocolPB impl)
* @param reconfigureProtocolService RPC protocol for reconfigure
* * (ReconfigureProtocolPB impl)
* @param handlerCount RPC server handler count
* @return RPC server
* @throws IOException if there is an I/O error while creating RPC server
*/
private RPC.Server startRpcServer(OzoneConfiguration conf,
InetSocketAddress addr, BlockingService clientProtocolService,
BlockingService interOMProtocolService,
BlockingService omAdminProtocolService,
BlockingService reconfigureProtocolService,
int handlerCount)
BlockingService reconfigureProtocolService)
throws IOException {

final int handlerCount = conf.getInt(OZONE_OM_HANDLER_COUNT_KEY,
OZONE_OM_HANDLER_COUNT_DEFAULT);
final int readThreads = conf.getInt(OZONE_OM_READ_THREADPOOL_KEY,
OZONE_OM_READ_THREADPOOL_DEFAULT);

RPC.Server rpcServer = preserveThreadName(() -> new RPC.Builder(conf)
.setProtocol(OzoneManagerProtocolPB.class)
.setInstance(clientProtocolService)
.setBindAddress(addr.getHostString())
.setPort(addr.getPort())
.setNumHandlers(handlerCount)
.setNumReaders(readThreads)
.setVerbose(false)
.setSecretManager(delegationTokenMgr)
.build());
Expand Down

0 comments on commit c77115a

Please sign in to comment.