aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/libpq/pqcomm.c10
-rw-r--r--src/include/pg_config_manual.h11
2 files changed, 4 insertions, 17 deletions
diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c
index 8ff3be611de..7112e9751b1 100644
--- a/src/backend/libpq/pqcomm.c
+++ b/src/backend/libpq/pqcomm.c
@@ -537,13 +537,11 @@ StreamServerPort(int family, const char *hostName, unsigned short portNumber,
}
/*
- * 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)
diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h
index 844c3e0f094..f2a106f983d 100644
--- a/src/include/pg_config_manual.h
+++ b/src/include/pg_config_manual.h
@@ -115,17 +115,6 @@
#define MAXPGPATH 1024
/*
- * PG_SOMAXCONN: maximum accept-queue length limit passed to
- * listen(2). You'd think we should use SOMAXCONN from
- * <sys/socket.h>, but on many systems that symbol is much smaller
- * than the kernel's actual limit. In any case, this symbol need be
- * twiddled only if you have a kernel that refuses large limit values,
- * rather than silently reducing the value to what it can handle
- * (which is what most if not all Unixen do).
- */
-#define PG_SOMAXCONN 10000
-
-/*
* You can try changing this if you have a machine with bytes of
* another size, but no guarantee...
*/