8000 Doc: document possible need to raise kernel's somaxconn limit. · postgres/postgres@04056e9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 04056e9

Browse files
committed
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
1 parent d0371f1 commit 04056e9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

doc/src/sgml/runtime.sgml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,6 +1358,22 @@ default:\
13581358
linkend="guc-max-files-per-process"/> configuration parameter to
13591359
limit the consumption of open files.
13601360
</para>
1361+
1362+
<para>
1363+
Another kernel limit that may be of concern when supporting large
1364+
numbers of client connections is the maximum socket connection queue
1365+
length. If more than that many connection requests arrive within a very
1366+
short period, some may get rejected before the postmaster can service
1367+
the requests, with those clients receiving unhelpful connection failure
1368+
errors such as <quote>Resource temporarily unavailable</quote> or
1369+
<quote>Connection refused</quote>. The default queue length limit is 128
1370+
on many platforms. To raise it, adjust the appropriate kernel parameter
1371+
via <application>sysctl</application>, then restart the postmaster.
1372+
The parameter is variously named <varname>net.core.somaxconn</varname>
1373+
on Linux, <varname>kern.ipc.soacceptqueue</varname> on newer FreeBSD,
1374+
and <varname>kern.ipc.somaxconn</varname> on macOS and other BSD
1375+
variants.
1376+
</para>
13611377
</sect2>
13621378

13631379
<sect2 id="linux-memory-overcommit">

0 commit comments

Comments
 (0)
0