Skip to content

Commit

Permalink
Remove our artificial PG_SOMAXCONN limit on listen queue length.
Browse files Browse the repository at this point in the history
This is just a port of community commit 0f47457 into our matching codebase.

Signed-off-by: Jason Teng <[email protected]>
  • Loading branch information
Jason Teng committed Dec 1, 2023
1 parent 2d4e2e0 commit 94ec3e5
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions contrib/babelfishpg_tds/src/backend/tds/support_funcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,11 @@ pe_create_server_port(int family, const char *hostName,
}

/*
* Select appropriate accept-queue length limit. PG_SOMAXCONN is only
* intended to provide a clamp on the request on platforms where an
* overly large request provokes a kernel error (are there any?).
* Select appropriate accept-queue length limit. It seems reasonable
* to use a value similar to the maximum number of child processes
* that the postmaster will permit.
*/
maxconn = MaxBackends * 2;
if (maxconn > PG_SOMAXCONN)
maxconn = PG_SOMAXCONN;
maxconn = MaxConnections * 2;

err = listen(fd, maxconn);
if (err < 0)
Expand Down

0 comments on commit 94ec3e5

Please sign in to comment.