linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: "Myklebust, Trond" <Trond.Myklebust@netapp.com>
Cc: NFS <linux-nfs@vger.kernel.org>
Subject: Re: NFSv4 callback: too many open  connections, consider increasing the number of threads.
Date: Tue, 31 Jul 2012 14:40:12 +1000	[thread overview]
Message-ID: <20120731144012.6d49b114@notabene.brown> (raw)
In-Reply-To: <1343690182.8362.6.camel@lade.trondhjem.org>

[-- Attachment #1: Type: text/plain, Size: 1549 bytes --]

On Mon, 30 Jul 2012 23:16:23 +0000 "Myklebust, Trond"
<Trond.Myklebust@netapp.com> wrote:

> Hi Neil,
> 
> Could you please add the missing s-o-b?
> 
> Cheers
>   Trond

Here 'tis.  Thanks.

NeilBrown

From: NeilBrown <neilb@suse.de>
Date: Tue, 31 Jul 2012 14:33:39 +1000
Subject: [PATCH] nfs: increase number of permitted callback connections.

By default a sunrpc service is limited to (N+3)*20 connections
where N is the number of threads.  This is 80 when N==1.
If this number is exceeded a warning is printed suggesting that
the number of threads be increased.  However with services which
run a single thread, this is impossible.

For such services there is a ->sv_maxconn setting that can be
used to forcibly increase the limit, and silence the message.
This is used by lockd.

The nfs client uses a sunrpc service to handle callbacks and
it too is single-threaded, so to avoid the useless messages,
and to allow a reasonable number of concurrent connections,
we need to set ->sv_maxconn.  1024 seems like a good number.

Signed-off-by: NeilBrown <neilb@suse.de>

diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
index 23ff18f..9cb1215 100644
--- a/fs/nfs/callback.c
+++ b/fs/nfs/callback.c
@@ -265,6 +265,10 @@ int nfs_callback_up(u32 minorversion, struct rpc_xprt *xprt)
 		ret = -ENOMEM;
 		goto out_err;
 	}
+	/* As there is only one thread we need to over-ride the
+	 * default maximum of 80 connections
+	 */
+	serv->sv_maxconn = 1024;
 
 	ret = svc_bind(serv, net);
 	if (ret < 0) {

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  reply	other threads:[~2012-07-31  4:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-19  6:46 NFSv4 callback: too many open connections, consider increasing the number of threads NeilBrown
2012-07-30 23:16 ` Myklebust, Trond
2012-07-31  4:40   ` NeilBrown [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-07-12  3:46 NeilBrown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120731144012.6d49b114@notabene.brown \
    --to=neilb@suse.de \
    --cc=Trond.Myklebust@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).