aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-08-23 09:55:37 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2022-08-23 09:56:01 -0400
commit7951e0d7af98fabec9e9146b409b4c5636932d66 (patch)
tree199bb770f637222363c41ddb96d53d86992bf5c5
parent384199ec505955ca1777b30f1ceea4b33ac82f4b (diff)
downloadpostgresql-7951e0d7af98fabec9e9146b409b4c5636932d66.tar.gz
postgresql-7951e0d7af98fabec9e9146b409b4c5636932d66.zip
Doc: document possible need to raise kernel's somaxconn limit.
On fast machines, it's possible for applications such as pgbench to issue connection requests so quickly that the postmaster's listen queue overflows in the kernel, resulting in unexpected failures (with not-very-helpful error messages). Most modern OSes allow the queue size to be increased, so document how to do that. Per report from Kevin McKibbin. Discussion: https://postgr.es/m/CADc_NKg2d+oZY9mg4DdQdoUcGzN2kOYXBu-3--RW_hEe0tUV=g@mail.gmail.com
-rw-r--r--doc/src/sgml/runtime.sgml16
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml
index 7fac9617ce7..f7429967178 100644
--- a/doc/src/sgml/runtime.sgml
+++ b/doc/src/sgml/runtime.sgml
@@ -1396,6 +1396,22 @@ default:\
linkend="guc-max-files-per-process"/> configuration parameter to
limit the consumption of open files.
</para>
+
+ <para>
+ Another kernel limit that may be of concern when supporting large
+ numbers of client connections is the maximum socket connection queue
+ length. If more than that many connection requests arrive within a very
+ short period, some may get rejected before the postmaster can service
+ the requests, with those clients receiving unhelpful connection failure
+ errors such as <quote>Resource temporarily unavailable</quote> or
+ <quote>Connection refused</quote>. The default queue length limit is 128
+ on many platforms. To raise it, adjust the appropriate kernel parameter
+ via <application>sysctl</application>, then restart the postmaster.
+ The parameter is variously named <varname>net.core.somaxconn</varname>
+ on Linux, <varname>kern.ipc.soacceptqueue</varname> on newer FreeBSD,
+ and <varname>kern.ipc.somaxconn</varname> on macOS and other BSD
+ variants.
+ </para>
</sect2>
<sect2 id="linux-memory-overcommit">