From 94ec3e5b4db162ef9539dead3c5b6a188eecc734 Mon Sep 17 00:00:00 2001 From: Jason Teng Date: Fri, 1 Dec 2023 19:28:51 +0000 Subject: [PATCH] Remove our artificial PG_SOMAXCONN limit on listen queue length. This is just a port of community commit 0f47457 into our matching codebase. Signed-off-by: Jason Teng --- .../babelfishpg_tds/src/backend/tds/support_funcs.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/contrib/babelfishpg_tds/src/backend/tds/support_funcs.c b/contrib/babelfishpg_tds/src/backend/tds/support_funcs.c index e5e4f7171c..c92e7d0e58 100644 --- a/contrib/babelfishpg_tds/src/backend/tds/support_funcs.c +++ b/contrib/babelfishpg_tds/src/backend/tds/support_funcs.c @@ -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)