I trying to benchmark gprc:
*Server:
Configuration:
EventLoopGroup acceptGroup = new EpollEventLoopGroup(1); // chỉ dùng 1 boss thread để accept kết nối
EventLoopGroup selectorGroup = new EpollEventLoopGroup(4);
NettyServerBuilder builder = NettyServerBuilder.forPort(port)
.addService(new GrpcHandler())
.bossEventLoopGroup(acceptGroup)
.workerEventLoopGroup(selectorGroup)
.channelType(EpollServerSocketChannel.class)
.withChildOption(ChannelOption.TCP_NODELAY, true)
.permitKeepAliveWithoutCalls(true)
.permitKeepAliveTime(5, TimeUnit.SECONDS)
.keepAliveTimeout(10, TimeUnit.SECONDS)
;
ExecutorService rpcExecutor = Executors.newFixedThreadPool(12);
builder.executor(rpcExecutor);
server = builder.build();
*Client:
Configuration:
EventLoopGroup selectorGroup = new EpollEventLoopGroup(1);
channel = NettyChannelBuilder.forTarget(_serverHost)
.usePlaintext()
.eventLoopGroup(selectorGroup)
.channelType(EpollSocketChannel.class, InetSocketAddress.class)
.directExecutor()
.withOption(ChannelOption.TCP_NODELAY, true)
.build();
Client I try to run 12 thread concurrent to call blockingStub by this channel. Total request is 1000000 -> each thread call blocking 1000000 / 12 req.
=> result about Throughput is low (~60000 req/s)and Latency is high.
I try to use Profiler of Intellij then I see this:

=> I guess only 1 thread to handle I/O => bottleneck
Can you help me explain it or I config wrong in anywhere?
Thank and best regards,
LinhCN - Zalo