make listen queue configurable (#4659)

revert-4814-Add_sequence_project_op
武毅 8 years ago committed by GitHub
parent aeccaf5631
commit 4da6e86ff7

@ -49,6 +49,11 @@ DEFINE_int32(sock_recv_buf_size,
1024 * 1024 * 40, 1024 * 1024 * 40,
"restrict sock recv buff size"); "restrict sock recv buff size");
/// reasonable sock_listen_queue_size can control maximum pending connections.
DEFINE_int32(sock_listen_queue_size,
1024,
"listen queue size when pserver listen a TCP port");
namespace paddle { namespace paddle {
/** /**
@ -129,7 +134,7 @@ SocketServer::SocketServer(const std::string &addr, int port, int rdmaCpu)
if (rdmaCpu == -1) { if (rdmaCpu == -1) {
tcpRdma_ = F_TCP; tcpRdma_ = F_TCP;
socket_ = 0; socket_ = 0;
maxPendingConnections_ = 100; maxPendingConnections_ = FLAGS_sock_listen_queue_size;
} else { } else {
tcpRdma_ = F_RDMA; tcpRdma_ = F_RDMA;
rdmaCpu_ = rdmaCpu; rdmaCpu_ = rdmaCpu;

Loading…
Cancel
Save