Linux NFS development
 help / color / mirror / Atom feed
* [PATCH v2] nfsd: allow more than 64 backlogged connections
@ 2024-03-08 18:02 trondmy
  2024-03-08 18:48 ` Jeff Layton
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: trondmy @ 2024-03-08 18:02 UTC (permalink / raw)
  To: Steve Dickson; +Cc: linux-nfs

From: Trond Myklebust <trond.myklebust@hammerspace.com>

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 <trond.myklebust@hammerspace.com>
---
v2: Use SOMAXCONN instead of a value of -1.

 utils/nfsd/nfssvc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/utils/nfsd/nfssvc.c b/utils/nfsd/nfssvc.c
index 46452d972407..9650cecee986 100644
--- a/utils/nfsd/nfssvc.c
+++ b/utils/nfsd/nfssvc.c
@@ -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;
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] nfsd: allow more than 64 backlogged connections
  2024-03-08 18:02 [PATCH v2] nfsd: allow more than 64 backlogged connections trondmy
@ 2024-03-08 18:48 ` Jeff Layton
  2024-03-08 18:56 ` Chuck Lever
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Jeff Layton @ 2024-03-08 18:48 UTC (permalink / raw)
  To: trondmy, Steve Dickson; +Cc: linux-nfs

On Fri, 2024-03-08 at 13:02 -0500, trondmy@gmail.com wrote:
> From: Trond Myklebust <trond.myklebust@hammerspace.com>
> 
> 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 <trond.myklebust@hammerspace.com>
> ---
> v2: Use SOMAXCONN instead of a value of -1.
> 
>  utils/nfsd/nfssvc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/utils/nfsd/nfssvc.c b/utils/nfsd/nfssvc.c
> index 46452d972407..9650cecee986 100644
> --- a/utils/nfsd/nfssvc.c
> +++ b/utils/nfsd/nfssvc.c
> @@ -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;

Reviewed-by: Jeff Layton <jlayton@kernel.org>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] nfsd: allow more than 64 backlogged connections
  2024-03-08 18:02 [PATCH v2] nfsd: allow more than 64 backlogged connections trondmy
  2024-03-08 18:48 ` Jeff Layton
@ 2024-03-08 18:56 ` Chuck Lever
  2024-03-11  7:55   ` Cedric Blancher
  2024-04-11 19:11 ` Trond Myklebust
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Chuck Lever @ 2024-03-08 18:56 UTC (permalink / raw)
  To: trondmy; +Cc: Steve Dickson, linux-nfs

On Fri, Mar 08, 2024 at 01:02:23PM -0500, trondmy@gmail.com 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 <trond.myklebust@hammerspace.com>
> ---
> v2: Use SOMAXCONN instead of a value of -1.
> 
>  utils/nfsd/nfssvc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/utils/nfsd/nfssvc.c b/utils/nfsd/nfssvc.c
> index 46452d972407..9650cecee986 100644
> --- a/utils/nfsd/nfssvc.c
> +++ b/utils/nfsd/nfssvc.c
> @@ -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;
> -- 
> 2.44.0

Acked-by: Chuck Lever <chuck.lever@oracle.com>

-- 
Chuck Lever

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] nfsd: allow more than 64 backlogged connections
  2024-03-08 18:56 ` Chuck Lever
@ 2024-03-11  7:55   ` Cedric Blancher
  0 siblings, 0 replies; 9+ messages in thread
From: Cedric Blancher @ 2024-03-11  7:55 UTC (permalink / raw)
  To: Chuck Lever; +Cc: trondmy, Steve Dickson, linux-nfs

Could you please ACK this for 6.6-LTS too ?

Ced

On Fri, 8 Mar 2024 at 19:58, Chuck Lever <chuck.lever@oracle.com> wrote:
>
> On Fri, Mar 08, 2024 at 01:02:23PM -0500, trondmy@gmail.com 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 <trond.myklebust@hammerspace.com>
> > ---
> > v2: Use SOMAXCONN instead of a value of -1.
> >
> >  utils/nfsd/nfssvc.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/utils/nfsd/nfssvc.c b/utils/nfsd/nfssvc.c
> > index 46452d972407..9650cecee986 100644
> > --- a/utils/nfsd/nfssvc.c
> > +++ b/utils/nfsd/nfssvc.c
> > @@ -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;
> > --
> > 2.44.0
>
> Acked-by: Chuck Lever <chuck.lever@oracle.com>
>
> --
> Chuck Lever
>


-- 
Cedric Blancher <cedric.blancher@gmail.com>
[https://plus.google.com/u/0/+CedricBlancher/]
Institute Pasteur

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] nfsd: allow more than 64 backlogged connections
  2024-03-08 18:02 [PATCH v2] nfsd: allow more than 64 backlogged connections trondmy
  2024-03-08 18:48 ` Jeff Layton
  2024-03-08 18:56 ` Chuck Lever
@ 2024-04-11 19:11 ` Trond Myklebust
  2024-04-12  1:56   ` Hanxiao Chen (Fujitsu)
  2024-05-09 13:31 ` Jeff Layton
  2024-05-10 13:18 ` Steve Dickson
  4 siblings, 1 reply; 9+ messages in thread
From: Trond Myklebust @ 2024-04-11 19:11 UTC (permalink / raw)
  To: SteveD@redhat.com; +Cc: linux-nfs@vger.kernel.org

On Fri, 2024-03-08 at 13:02 -0500, trondmy@gmail.com wrote:
> From: Trond Myklebust <trond.myklebust@hammerspace.com>
> 
> 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 <trond.myklebust@hammerspace.com>
> ---
> v2: Use SOMAXCONN instead of a value of -1.
> 
>  utils/nfsd/nfssvc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/utils/nfsd/nfssvc.c b/utils/nfsd/nfssvc.c
> index 46452d972407..9650cecee986 100644
> --- a/utils/nfsd/nfssvc.c
> +++ b/utils/nfsd/nfssvc.c
> @@ -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;

Ping on the above.

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] nfsd: allow more than 64 backlogged connections
  2024-04-11 19:11 ` Trond Myklebust
@ 2024-04-12  1:56   ` Hanxiao Chen (Fujitsu)
  0 siblings, 0 replies; 9+ messages in thread
From: Hanxiao Chen (Fujitsu) @ 2024-04-12  1:56 UTC (permalink / raw)
  To: Trond Myklebust, SteveD@redhat.com; +Cc: linux-nfs@vger.kernel.org



> -----邮件原件-----
> 发件人: Trond Myklebust <trondmy@hammerspace.com>
> 发送时间: 2024年4月12日 3:12
> 收件人: SteveD@redhat.com
> 抄送: linux-nfs@vger.kernel.org
> 主题: Re: [PATCH v2] nfsd: allow more than 64 backlogged connections
> 
> On Fri, 2024-03-08 at 13:02 -0500, trondmy@gmail.com wrote:
> > From: Trond Myklebust <trond.myklebust@hammerspace.com>
> >
> > 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.
> >

Tested-by: Chen Hanxiao <chenhx.fnst@fujitsu.com>

Regards,
- Chen

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] nfsd: allow more than 64 backlogged connections
  2024-03-08 18:02 [PATCH v2] nfsd: allow more than 64 backlogged connections trondmy
                   ` (2 preceding siblings ...)
  2024-04-11 19:11 ` Trond Myklebust
@ 2024-05-09 13:31 ` Jeff Layton
  2024-05-10 11:27   ` Steve Dickson
  2024-05-10 13:18 ` Steve Dickson
  4 siblings, 1 reply; 9+ messages in thread
From: Jeff Layton @ 2024-05-09 13:31 UTC (permalink / raw)
  To: trondmy, Steve Dickson; +Cc: linux-nfs

On Fri, 2024-03-08 at 13:02 -0500, trondmy@gmail.com wrote:
> From: Trond Myklebust <trond.myklebust@hammerspace.com>
> 
> 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 <trond.myklebust@hammerspace.com>
> ---
> v2: Use SOMAXCONN instead of a value of -1.
> 
>  utils/nfsd/nfssvc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/utils/nfsd/nfssvc.c b/utils/nfsd/nfssvc.c
> index 46452d972407..9650cecee986 100644
> --- a/utils/nfsd/nfssvc.c
> +++ b/utils/nfsd/nfssvc.c
> @@ -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;

Steve,

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 <jlayton@kernel.org>

-- 
Jeff Layton <jlayton@poochiereds.net>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] nfsd: allow more than 64 backlogged connections
  2024-05-09 13:31 ` Jeff Layton
@ 2024-05-10 11:27   ` Steve Dickson
  0 siblings, 0 replies; 9+ messages in thread
From: Steve Dickson @ 2024-05-10 11:27 UTC (permalink / raw)
  To: Jeff Layton, trondmy; +Cc: linux-nfs



On 5/9/24 9:31 AM, Jeff Layton wrote:
> On Fri, 2024-03-08 at 13:02 -0500, trondmy@gmail.com wrote:
>> From: Trond Myklebust <trond.myklebust@hammerspace.com>
>>
>> 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 <trond.myklebust@hammerspace.com>
>> ---
>> v2: Use SOMAXCONN instead of a value of -1.
>>
>>   utils/nfsd/nfssvc.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/utils/nfsd/nfssvc.c b/utils/nfsd/nfssvc.c
>> index 46452d972407..9650cecee986 100644
>> --- a/utils/nfsd/nfssvc.c
>> +++ b/utils/nfsd/nfssvc.c
>> @@ -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;
> 
> Steve,
> 
> 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 <jlayton@kernel.org>
> 
Thanks for the poke... The patch was not on my todo list.

I'm on it...

steved.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] nfsd: allow more than 64 backlogged connections
  2024-03-08 18:02 [PATCH v2] nfsd: allow more than 64 backlogged connections trondmy
                   ` (3 preceding siblings ...)
  2024-05-09 13:31 ` Jeff Layton
@ 2024-05-10 13:18 ` Steve Dickson
  4 siblings, 0 replies; 9+ messages in thread
From: Steve Dickson @ 2024-05-10 13:18 UTC (permalink / raw)
  To: trondmy; +Cc: linux-nfs



On 3/8/24 1:02 PM, trondmy@gmail.com wrote:
> From: Trond Myklebust <trond.myklebust@hammerspace.com>
> 
> 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 <trond.myklebust@hammerspace.com>
Committed... Sorry it took so long... The patch was not
on my radar... Feel free to ping when things linger this long.

steved.

> ---
> v2: Use SOMAXCONN instead of a value of -1.
> 
>   utils/nfsd/nfssvc.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/utils/nfsd/nfssvc.c b/utils/nfsd/nfssvc.c
> index 46452d972407..9650cecee986 100644
> --- a/utils/nfsd/nfssvc.c
> +++ b/utils/nfsd/nfssvc.c
> @@ -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;


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-05-10 13:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-08 18:02 [PATCH v2] nfsd: allow more than 64 backlogged connections trondmy
2024-03-08 18:48 ` Jeff Layton
2024-03-08 18:56 ` Chuck Lever
2024-03-11  7:55   ` Cedric Blancher
2024-04-11 19:11 ` Trond Myklebust
2024-04-12  1:56   ` Hanxiao Chen (Fujitsu)
2024-05-09 13:31 ` Jeff Layton
2024-05-10 11:27   ` Steve Dickson
2024-05-10 13:18 ` Steve Dickson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox