[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-nfs
Subject:    Re: [PATCH v2] nfsd: allow more than 64 backlogged connections
From:       Steve Dickson <steved () redhat ! com>
Date:       2024-05-10 13:18:01
Message-ID: 39ac3688-e99c-4b80-a94c-c80f9e2dc31b () redhat ! com
[Download RAW message or body]



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;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic