coolbeevip commented on a change in pull request #593: [SCB-1593] Use Netty
native transport improve performance
URL: https://github.com/apache/servicecomb-pack/pull/593#discussion_r346734660
##########
File path:
alpha/alpha-server/src/main/java/org/apache/servicecomb/pack/alpha/server/GrpcStartable.java
##########
@@ -103,9 +109,9 @@ public GrpcServerConfig getGrpcServerConfig() {
private ServerBuilder getServerBuilder(int port) {
return NettyServerBuilder.forAddress(
new InetSocketAddress(serverConfig.getHost(), port))
- .channelType(NioServerSocketChannel.class)
- .bossEventLoopGroup(new NioEventLoopGroup(1))
- .workerEventLoopGroup(new NioEventLoopGroup());
+ .channelType(selectorServerChannel())
+ .bossEventLoopGroup(selectorEventLoopGroup(1))
+ .workerEventLoopGroup(selectorEventLoopGroup(0));
Review comment:
If the number of threads is set to 0, the use default value
DEFAULT_EVENT_LOOP_THREADS = Math.max(1,
SystemPropertyUtil.getInt("io.netty.eventLoopThreads",
NettyRuntime.availableProcessors() * 2));
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services