From patchwork Tue Jul 31 04:40:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 1257121 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 597573FC1A for ; Tue, 31 Jul 2012 04:40:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752171Ab2GaEk2 (ORCPT ); Tue, 31 Jul 2012 00:40:28 -0400 Received: from cantor2.suse.de ([195.135.220.15]:56294 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751968Ab2GaEk2 (ORCPT ); Tue, 31 Jul 2012 00:40:28 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 0D3D4A30B9; Tue, 31 Jul 2012 06:40:26 +0200 (CEST) Date: Tue, 31 Jul 2012 14:40:12 +1000 From: NeilBrown To: "Myklebust, Trond" Cc: NFS Subject: Re: NFSv4 callback: too many open connections, consider increasing the number of threads. Message-ID: <20120731144012.6d49b114@notabene.brown> In-Reply-To: <1343690182.8362.6.camel@lade.trondhjem.org> References: <20120719164602.7d5aadaf@notabene.brown> <1343690182.8362.6.camel@lade.trondhjem.org> X-Mailer: Claws Mail 3.7.10 (GTK+ 2.24.7; x86_64-suse-linux-gnu) Mime-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Mon, 30 Jul 2012 23:16:23 +0000 "Myklebust, Trond" wrote: > Hi Neil, > > Could you please add the missing s-o-b? > > Cheers > Trond Here 'tis. Thanks. NeilBrown From: NeilBrown 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 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) {