Skip to content

Commit 4da6e86

Browse files
authored
make listen queue configurable (#4659)
1 parent aeccaf5 commit 4da6e86

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

paddle/pserver/LightNetwork.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ DEFINE_int32(sock_recv_buf_size,
4949
1024 * 1024 * 40,
5050
"restrict sock recv buff size");
5151

52+
/// reasonable sock_listen_queue_size can control maximum pending connections.
53+
DEFINE_int32(sock_listen_queue_size,
54+
1024,
55+
"listen queue size when pserver listen a TCP port");
56+
5257
namespace paddle {
5358

5459
/**
@@ -129,7 +134,7 @@ SocketServer::SocketServer(const std::string &addr, int port, int rdmaCpu)
129134
if (rdmaCpu == -1) {
130135
tcpRdma_ = F_TCP;
131136
socket_ = 0;
132-
maxPendingConnections_ = 100;
137+
maxPendingConnections_ = FLAGS_sock_listen_queue_size;
133138
} else {
134139
tcpRdma_ = F_RDMA;
135140
rdmaCpu_ = rdmaCpu;

0 commit comments

Comments
 (0)