我们正在尝试解决处理大量 Http POST 请求的问题,而在使用 Netty Server 时,我只能处理~50K requests/sec太低的请求。
我的问题是如何调整此服务器以确保处理> 1.5 million requests/second?
Netty4 服务器
// Configure the server.
EventLoopGroup bossGroup = new NioEventLoopGroup();
EventLoopGroup workerGroup = new NioEventLoopGroup();
try {
ServerBootstrap b = new ServerBootstrap();
b.option(ChannelOption.SO_BACKLOG, 1024);
b.group(bossGroup, workerGroup)
.channel(NioServerSocketChannel.class)
.handler(new LoggingHandler(LogLevel.INFO))
.childHandler(new HttpServerInitializer(sslCtx));
Channel ch = b.bind(PORT).sync().channel();
System.err.println("Open your web browser and navigate to " +
(SSL? "https" : "http") + "://127.0.0.1:" + PORT + '/');
ch.closeFuture().sync();
} finally {
bossGroup.shutdownGracefully();
workerGroup.shutdownGracefully();
}
Run Code Online (Sandbox Code Playgroud)
初始化程序
public …Run Code Online (Sandbox Code Playgroud)