Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0f47457

Browse files
committed
Remove our artificial PG_SOMAXCONN limit on listen queue length.
I added this in commit153f400, out of paranoia about kernelspossibly rejecting very large listen backlog requests. However,POSIX has said for decades that the kernel must silently reduceany value it considers too large, and there's no evidence thatany current system doesn't obey that. Let's just drop this limitand save some complication.While we're here, compute the request as twice MaxConnections nottwice MaxBackends; the latter no longer means what it did in 2001.Per discussion of a report from Kevin McKibbin.Discussion:https://postgr.es/m/CADc_NKg2d+oZY9mg4DdQdoUcGzN2kOYXBu-3--RW_hEe0tUV=g@mail.gmail.com
1 parentba94dfd commit0f47457

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

‎src/backend/libpq/pqcomm.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -537,13 +537,11 @@ StreamServerPort(int family, const char *hostName, unsigned short portNumber,
537537
}
538538

539539
/*
540-
* Select appropriate accept-queue length limit.PG_SOMAXCONN is only
541-
*intendedtoprovide aclamp ontherequest on platforms where an
542-
*overly large request provokes a kernel error (are there any?).
540+
* Select appropriate accept-queue length limit.It seems reasonable
541+
* touse avalue similar tothemaximum number of child processes
542+
*that the postmaster will permit.
543543
*/
544-
maxconn=MaxBackends*2;
545-
if (maxconn>PG_SOMAXCONN)
546-
maxconn=PG_SOMAXCONN;
544+
maxconn=MaxConnections*2;
547545

548546
err=listen(fd,maxconn);
549547
if (err<0)

‎src/include/pg_config_manual.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -114,17 +114,6 @@
114114
*/
115115
#defineMAXPGPATH1024
116116

117-
/*
118-
* PG_SOMAXCONN: maximum accept-queue length limit passed to
119-
* listen(2). You'd think we should use SOMAXCONN from
120-
* <sys/socket.h>, but on many systems that symbol is much smaller
121-
* than the kernel's actual limit. In any case, this symbol need be
122-
* twiddled only if you have a kernel that refuses large limit values,
123-
* rather than silently reducing the value to what it can handle
124-
* (which is what most if not all Unixen do).
125-
*/
126-
#definePG_SOMAXCONN10000
127-
128117
/*
129118
* You can try changing this if you have a machine with bytes of
130119
* another size, but no guarantee...

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp