Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions fe/src/main/java/org/apache/doris/common/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,21 @@ public class Config extends ConfigBase {
* Currently, all FEs' http port must be same.
*/
@ConfField public static int http_port = 8030;

/*
* The backlog_num for netty http server
* When you enlarge this backlog_num, you should ensure it's value larger than
* the linux /proc/sys/net/core/somaxconn config
*/
@ConfField public static int http_backlog_num = 1024;

/*
* The backlog_num for thrift server
* When you enlarge this backlog_num, you should ensure it's value larger than
* the linux /proc/sys/net/core/somaxconn config
*/
@ConfField public static int thrift_backlog_num = 1024;

/*
* FE thrift server port
*/
Expand Down
12 changes: 9 additions & 3 deletions fe/src/main/java/org/apache/doris/common/ThriftServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.apache.thrift.transport.TTransportException;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.util.Set;

public class ThriftServer {
Expand Down Expand Up @@ -69,10 +70,15 @@ private void createThreadedServer() throws TTransportException {
}

private void createThreadPoolServer() throws TTransportException {
TThreadPoolServer.Args args =
new TThreadPoolServer.Args(new TServerSocket(port)).protocolFactory(
TServerSocket.ServerSocketTransportArgs socketTransportArgs = new TServerSocket.ServerSocketTransportArgs()
.bindAddr(new InetSocketAddress(port))
.clientTimeout(0)
.backlog(Config.thrift_backlog_num);

TThreadPoolServer.Args serverArgs =
new TThreadPoolServer.Args(new TServerSocket(socketTransportArgs)).protocolFactory(
new TBinaryProtocol.Factory()).processor(processor);
server = new TThreadPoolServer(args);
server = new TThreadPoolServer(serverArgs);
}

public void start() throws IOException {
Expand Down
4 changes: 2 additions & 2 deletions fe/src/main/java/org/apache/doris/http/HttpServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.doris.http;

import org.apache.doris.common.Config;
import org.apache.doris.http.action.BackendAction;
import org.apache.doris.http.action.HaAction;
import org.apache.doris.http.action.HelpAction;
Expand Down Expand Up @@ -88,7 +89,6 @@

public class HttpServer {
private static final Logger LOG = LogManager.getLogger(HttpServer.class);
private static final int BACKLOG_NUM = 128;
private QeService qeService = null;
private int port;
private ActionController controller;
Expand Down Expand Up @@ -196,7 +196,7 @@ public void run() {
EventLoopGroup workerGroup = new NioEventLoopGroup();
try {
serverBootstrap = new ServerBootstrap();
serverBootstrap.option(ChannelOption.SO_BACKLOG, BACKLOG_NUM);
serverBootstrap.option(ChannelOption.SO_BACKLOG, Config.http_backlog_num);
serverBootstrap.group(bossGroup, workerGroup)
.channel(NioServerSocketChannel.class)
.childHandler(new PaloHttpServerInitializer());
Expand Down