nfsd: allow more than 64 backlogged connections
Subsystems (2)
PATCH v2 1/1 nfsd: allow more than 64 backlogged connections
From: Trond Myklebust <[email protected]>
When creating a listener socket to be handed to /proc/fs/nfsd/portlist, we currently limit the number of backlogged connections to 64. Since that value was chosen in 2006, the scale at which data centres operate has changed significantly. Given a modern server with many thousands of clients, a limit of 64 connections can create bottlenecks, particularly at at boot time.
Let's use the POSIX-sanctioned maximum value of SOMAXCONN.
---
v2: Use SOMAXCONN instead of a value of -1.
utils/nfsd/nfssvc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
utils/nfsd/nfssvc.c +2 -1
@@ -205,7 +205,8 @@ nfssvc_setfds(const struct addrinfo *hints, const char *node, const char *port) rc = errno; goto error; } -if (addr->ai_protocol ==IPPROTO_TCP &&listen (sockfd,64 )) { +if (addr->ai_protocol ==IPPROTO_TCP && +listen (sockfd,SOMAXCONN )) {xlog (L_ERROR ,"unable to create listening socket: " "errno %d (%m)" , errno); rc = errno;
Signature · 1 line
2.44.0
Quoted 22 lines · On Fri, 2024-03-08 at 13:02 -0500, [email protected] wrote:
From: Trond Myklebust <[email protected]>
When creating a listener socket to be handed to
/proc/fs/nfsd/portlist, we currently limit the number of backlogged connections to 64. Since that value was chosen in 2006, the scale at which data centres operate has changed significantly. Given a modern server with many thousands of clients, a limit of 64 connections can create bottlenecks, particularly at at boot time.
Let's use the POSIX-sanctioned maximum value of SOMAXCONN.Signed-off-by Trond Myklebust <[email protected]>---
v2: Use SOMAXCONN instead of a value of -1.utils/nfsd/nfssvc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)utils/nfsd/nfssvc.c +0
-0
utils/nfsd/nfssvc.c nfssvc_setfds(const struct addrinfo *hints, const char *node, const char *port) · line 212
Quoted 9 lines
utils/nfsd/nfssvc.c +2
-1@@ -205,7 +205,8 @@ nfssvc_setfds(const struct addrinfo *hints, const char *node, const char *port) rc = errno; goto error; } -if (addr->ai_protocol ==IPPROTO_TCP &&listen (sockfd,64 )) { +if (addr->ai_protocol ==IPPROTO_TCP && +listen (sockfd,SOMAXCONN )) {xlog (L_ERROR ,"unable to create listening socket: " "errno %d (%m)" , errno); rc = errno;
Quoted 31 lines · On Fri, Mar 08, 2024 at 01:02:23PM -0500, [email protected] wrote:
When creating a listener socket to be handed to
/proc/fs/nfsd/portlist, we currently limit the number of backlogged connections to 64. Since that value was chosen in 2006, the scale at which data centres operate has changed significantly. Given a modern server with many thousands of clients, a limit of 64 connections can create bottlenecks, particularly at at boot time.
Let's use the POSIX-sanctioned maximum value of SOMAXCONN.Signed-off-by Trond Myklebust <[email protected]>---
v2: Use SOMAXCONN instead of a value of -1.utils/nfsd/nfssvc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)utils/nfsd/nfssvc.c +2
-1@@ -205,7 +205,8 @@ nfssvc_setfds(const struct addrinfo *hints, const char *node, const char *port) rc = errno; goto error; } -if (addr->ai_protocol ==IPPROTO_TCP &&listen (sockfd,64 )) { +if (addr->ai_protocol ==IPPROTO_TCP && +listen (sockfd,SOMAXCONN )) {xlog (L_ERROR ,"unable to create listening socket: " "errno %d (%m)" , errno); rc = errno;Signature · 1 line
2.44.0
Signature · 1 line
Chuck Lever
Could you please ACK this for 6.6-LTS too ?
Ced
Quoted 39 lines · Chuck Lever
Quoted 30 lines · On Fri, Mar 08, 2024 at 01:02:23PM -0500, [email protected] wrote:
When creating a listener socket to be handed to
/proc/fs/nfsd/portlist, we currently limit the number of backlogged connections to 64. Since that value was chosen in 2006, the scale at which data centres operate has changed significantly. Given a modern server with many thousands of clients, a limit of 64 connections can create bottlenecks, particularly at at boot time.
Let's use the POSIX-sanctioned maximum value of SOMAXCONN.Signed-off-by Trond Myklebust <[email protected]>---
v2: Use SOMAXCONN instead of a value of -1.utils/nfsd/nfssvc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)utils/nfsd/nfssvc.c +2
-2@@ -205,7 +205,8 @@ nfssvc_setfds(const struct addrinfo *hints, const char *node, const char *port) rc = errno; goto error; } -if (addr->ai_protocol ==IPPROTO_TCP &&listen (sockfd,64 )) { +if (addr->ai_protocol ==IPPROTO_TCP && +listen (sockfd,SOMAXCONN )) {xlog (L_ERROR ,"unable to create listening socket: " "errno %d (%m)" , errno); rc = errno; --Quoted 1 line
2.44.0
Acked-by Chuck Lever <[email protected]>--
Chuck Lever
Signature · 3 lines
Cedric Blancher <[email protected]> [https://plus.google.com/u/0/+CedricBlancher/] Institute Pasteur
Quoted 34 lines · On Fri, 2024-03-08 at 13:02 -0500, [email protected] wrote:
From: Trond Myklebust <[email protected]>
When creating a listener socket to be handed to
/proc/fs/nfsd/portlist,
we currently limit the number of backlogged connections to 64. Since that value was chosen in 2006, the scale at which data centres operate
has changed significantly. Given a modern server with many thousands of
clients, a limit of 64 connections can create bottlenecks, particularly
at at boot time.
Let's use the POSIX-sanctioned maximum value of SOMAXCONN.Signed-off-by Trond Myklebust <[email protected]>---
v2: Use SOMAXCONN instead of a value of -1.utils/nfsd/nfssvc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)utils/nfsd/nfssvc.c +2
-1@@ -205,7 +205,8 @@ nfssvc_setfds(const struct addrinfo *hints, const char *node, const char *port) rc = errno; goto error; } -if (addr->ai_protocol ==IPPROTO_TCP && listen(sockfd, 64)) { +if (addr->ai_protocol ==IPPROTO_TCP && + listen(sockfd, SOMAXCONN)) {
Quoted 4 lines
xlog(L_ERROR, "unable to create listening
socket: "
"errno %d (%m)", errno); rc = errno;
Ping on the above.
Signature · 3 lines
Trond Myklebust Linux NFS client maintainer, Hammerspace [email protected]
Hanxiao Chen (Fujitsu)
Tested-byQuoted 24 lines
-----邮件原件-----
发件人: Trond Myklebust <[email protected]>
发送时间: 2024年4月12日 3:12
收件人: [email protected]
抄送: [email protected]
主题: Re: [PATCH v2] nfsd: allow more than 64 backlogged connectionsQuoted 14 lines · On Fri, 2024-03-08 at 13:02 -0500, [email protected] wrote:
From: Trond Myklebust <[email protected]>
When creating a listener socket to be handed to
/proc/fs/nfsd/portlist,
we currently limit the number of backlogged connections to 64. Since that value was chosen in 2006, the scale at which data centres operate
has changed significantly. Given a modern server with many thousands of
clients, a limit of 64 connections can create bottlenecks, particularly
at at boot time.
Let's use the POSIX-sanctioned maximum value of SOMAXCONN.
Regards,
- Chen
Quoted 34 lines · On Fri, 2024-03-08 at 13:02 -0500, [email protected] wrote:
From: Trond Myklebust <[email protected]>
When creating a listener socket to be handed to
/proc/fs/nfsd/portlist,
we currently limit the number of backlogged connections to 64. Since that value was chosen in 2006, the scale at which data centres operate
has changed significantly. Given a modern server with many thousands of
clients, a limit of 64 connections can create bottlenecks, particularly
at at boot time.
Let's use the POSIX-sanctioned maximum value of SOMAXCONN.Signed-off-by Trond Myklebust <[email protected]>---
v2: Use SOMAXCONN instead of a value of -1.utils/nfsd/nfssvc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)utils/nfsd/nfssvc.c +2
-1@@ -205,7 +205,8 @@ nfssvc_setfds(const struct addrinfo *hints, const char *node, const char *port) rc = errno; goto error; } -if (addr->ai_protocol ==IPPROTO_TCP && listen(sockfd, 64)) { +if (addr->ai_protocol ==IPPROTO_TCP && + listen(sockfd, SOMAXCONN)) {
Quoted 4 lines
xlog(L_ERROR, "unable to create listening
socket: "
"errno %d (%m)", errno); rc = errno;
Steve,
Is there some reason you've not committed this patch? It seems fairly straightforward. I think I sent this earlier, but:
Signature · 1 line
Jeff Layton <[email protected]>
Quoted 42 lines · Jeff Layton
Quoted 35 lines · On Fri, 2024-03-08 at 13:02 -0500, [email protected] wrote:
From: Trond Myklebust <[email protected]>
When creating a listener socket to be handed to
/proc/fs/nfsd/portlist,
we currently limit the number of backlogged connections to 64. Since that value was chosen in 2006, the scale at which data centres operate
has changed significantly. Given a modern server with many thousands of
clients, a limit of 64 connections can create bottlenecks, particularly
at at boot time.
Let's use the POSIX-sanctioned maximum value of SOMAXCONN.Signed-off-by Trond Myklebust <[email protected]>---
v2: Use SOMAXCONN instead of a value of -1.utils/nfsd/nfssvc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)utils/nfsd/nfssvc.c +2
-1@@ -205,7 +205,8 @@ nfssvc_setfds(const struct addrinfo *hints, const char *node, const char *port) rc = errno; goto error; } -if (addr->ai_protocol ==IPPROTO_TCP && listen(sockfd, 64)) { +if (addr->ai_protocol ==IPPROTO_TCP && + listen(sockfd, SOMAXCONN)) { xlog(L_ERROR, "unable to create listeningQuoted 3 lines
socket: "
"errno %d (%m)", errno); rc = errno;Steve,
Quoted 5 lines
Is there some reason you've not committed this patch? It seems fairly straightforward. I think I sent this earlier, but:
Reviewed-by Jeffrey Layton <[email protected]>
Thanks for the poke... The patch was not on my todo list.
I'm on it...
steved.
Quoted 11 lines · On 3/8/24 1:02 PM, [email protected] wrote:
From: Trond Myklebust <[email protected]>
When creating a listener socket to be handed to
/proc/fs/nfsd/portlist, we currently limit the number of backlogged connections to 64. Since that value was chosen in 2006, the scale at which data centres operate has changed significantly. Given a modern server with many thousands of clients, a limit of 64 connections can create bottlenecks, particularly at at boot time.
Let's use the POSIX-sanctioned maximum value of SOMAXCONN.Signed-off-by Trond Myklebust <[email protected]>
Committed... Sorry it took so long... The patch was not on my radar... Feel free to ping when things linger this long.
steved.
Quoted 20 lines
---
v2: Use SOMAXCONN instead of a value of -1.utils/nfsd/nfssvc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)utils/nfsd/nfssvc.c +2
-1@@ -205,7 +205,8 @@ nfssvc_setfds(const struct addrinfo *hints, const char *node, const char *port) rc = errno; goto error; } -if (addr->ai_protocol ==IPPROTO_TCP &&listen (sockfd,64 )) { +if (addr->ai_protocol ==IPPROTO_TCP && +listen (sockfd,SOMAXCONN )) {xlog (L_ERROR ,"unable to create listening socket: " "errno %d (%m)" , errno); rc = errno;