From owner-freebsd-stable@freebsd.org Wed Dec 16 00:21:07 2015 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6FDDA49042 for ; Wed, 16 Dec 2015 00:21:07 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.net.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 8D7BE1223 for ; Wed, 16 Dec 2015 00:21:06 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) IronPort-PHdr: 9a23:K3HiuhOxr5wOD0FW84Ml6mtUPXoX/o7sNwtQ0KIMzox0KPj+rarrMEGX3/hxlliBBdydsKIazbKO+4nbGkU+or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6anHS+4HYoFwnlMkItf6KuStCU15z//tvx0qOQSj0AvCC6b7J2IUf+hiTqne5Sv7FfLL0swADCuHpCdrce72ppIVWOg0S0vZ/or9YwuxhX7tw7/shDGan3N44/UfQMCDU9L3sd/8DirxLDXE2J62dKAUsMlR8dOQnO71nfV5zytib//r5n3SCRPsn7SJgpXju/4qNzSFnjgXFUZHYC7GjLh5ko3+pgqxW7qkknzg== X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2B9AgC9rXBW/61jaINehAxtBr1TDoFjFwqFIkoCgXkUAQEBAQEBAQGBCYItggcBAQEDAQEBASAEJyALEAIBCBgRGQICAiUBCSYCBAgHBAEZAwSIBggOq1KRfwEBAQEBAQEBAQEBAQEBAQEBAQERBQSGVoR9hDsBAQUWGYMGgUkFjTV3iFCCbYJMhSKESYdtj12DcgIfAUOCER2BdCA0B4MrOoEIAQEB X-IronPort-AV: E=Sophos;i="5.20,434,1444708800"; d="scan'208";a="258051917" Received: from nipigon.cs.uoguelph.ca (HELO zcs1.mail.uoguelph.ca) ([131.104.99.173]) by esa-annu.net.uoguelph.ca with ESMTP; 15 Dec 2015 19:21:05 -0500 Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 3D0CF15F55D; Tue, 15 Dec 2015 19:21:05 -0500 (EST) Received: from zcs1.mail.uoguelph.ca ([127.0.0.1]) by localhost (zcs1.mail.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id jrMqIg69amCv; Tue, 15 Dec 2015 19:21:04 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 1E6B915F565; Tue, 15 Dec 2015 19:21:04 -0500 (EST) X-Virus-Scanned: amavisd-new at zcs1.mail.uoguelph.ca Received: from zcs1.mail.uoguelph.ca ([127.0.0.1]) by localhost (zcs1.mail.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id LxqYyxy_TV92; Tue, 15 Dec 2015 19:21:04 -0500 (EST) Received: from zcs1.mail.uoguelph.ca (zcs1.mail.uoguelph.ca [172.17.95.18]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id EA2E515F55D; Tue, 15 Dec 2015 19:21:03 -0500 (EST) Date: Tue, 15 Dec 2015 19:21:03 -0500 (EST) From: Rick Macklem To: Frank de Bot Cc: freebsd-stable@FreeBSD.org Message-ID: <216819142.133672616.1450225263922.JavaMail.zimbra@uoguelph.ca> In-Reply-To: <5603FC85.8070105@searchy.net> References: <1031959302.30289198.1430594914473.JavaMail.root@uoguelph.ca> <5603AE3D.5090407@searchy.net> <1887696626.8730412.1443097925392.JavaMail.zimbra@uoguelph.ca> <5603FC85.8070105@searchy.net> Subject: Re: kernel process [nfscl] high cpu MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_133672613_387212164.1450225263919" X-Originating-IP: [172.17.95.10] X-Mailer: Zimbra 8.0.9_GA_6191 (ZimbraWebClient - FF42 (Win)/8.0.9_GA_6191) Thread-Topic: kernel process [nfscl] high cpu Thread-Index: CGlZHUCzjeJo6zCEBVa/AHY6vNL30A== X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2015 00:21:08 -0000 ------=_Part_133672613_387212164.1450225263919 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Frank de Bot wrote: > Rick Macklem wrote: > > Frank de Bot wrote: > >> Rick Macklem wrote: > >>> Frank de Bot wrote: > >>>> Hi, > >>>> > >>>> On a 10.1-RELEASE-p9 server I have several NFS mounts used for a > >>>> jail. > >>>> Because it's a server only to test, there is a low load. But the > >>>> [nfscl] > >>>> process is hogging a CPU after a while. This happens pretty fast, > >>>> within > >>>> 1 or 2 days. I'm noticing the high CPU of the process when I want to > >>>> do > >>>> some test after a little while (those 1 or 2 days). > >>>> > >>>> My jail.conf look like: > >>>> > >>>> exec.start = "/bin/sh /etc/rc"; > >>>> exec.stop = "/bin/sh /etc/rc.shutdown"; > >>>> exec.clean; > >>>> mount.devfs; > >>>> exec.consolelog = "/var/log/jail.$name.log"; > >>>> #mount.fstab = "/usr/local/etc/jail.fstab.$name"; > >>>> > >>>> test01 { > >>>> host.hostname = "test01_hosting"; > >>>> ip4.addr = somepublicaddress; > >>>> ip4.addr += someprivateaddress; > >>>> > >>>> mount = "10.13.37.2:/tank/hostingbase /opt/jails/test01 > >>>> nfs nfsv4,minorversion=1,pnfs,ro,noatime 0 0"; > >>>> mount += "10.13.37.2:/tank/hosting/test > >>>> /opt/jails/test01/opt nfs nfsv4,minorversion=1,pnfs,noatime > >>>> 0 0"; > >>>> > >>>> path = "/opt/jails/test01"; > >>>> } > >>>> > >>>> Last test was with NFS 4.1, I also worked with NFS 4.(0) with the > >>>> same > >>>> result. In the readonly nfs share there are symbolic links point to > >>>> the > >>>> read-write share for logging, storing .run files, etc. When I monitor > >>>> my > >>>> network interface with tcpdump, there is little nfs traffic, only > >>>> when I > >>>> do try to access the shares there is activity. > >>>> > >>>> What is causing nfscl to run around in circles, hogging the CPU (it > >>>> makes the system slow to respond too) or how can I found out what's > >>>> the > >>>> cause? > >>>> > >>> Well, the nfscl does server->client RPCs referred to as callbacks. I > >>> have no idea what the implications of running it in a jail is, but I'd > >>> guess that these server->client RPCs get blocked somehow, etc... > >>> (The NFSv4.0 mechanism requires a separate IP address that the server > >>> can connect to on the client. For NFSv4.1, it should use the same > >>> TCP connection as is used for the client->server RPCs. The latter > >>> seems like it should work, but there is probably some glitch.) > >>> > >>> ** Just run without the nfscl daemon (it is only needed for delegations > >>> or > >>> pNFS). > >> > >> How can I disable the nfscl daemon? > >> > > Well, the daemon for the callbacks is called nfscbd. > > You should check via "ps ax", to see if you have it running. > > (For NFSv4.0 you probably don't want it running, but for NFSv4.1 you > > do need it. pNFS won't work at all without it, but unless you have a > > server that supports pNFS, it won't work anyhow. Unless your server is > > a clustered Netapp Filer, you should probably not have the "pnfs" option.) > > > > To run the "nfscbd" daemon you can set: > > nfscbd_enable="TRUE" > > in your /etc/rc.conf will start it on boot. > > Alternately, just type "nfscbd" as root. > > > > The "nfscl" thread is always started when an NFSv4 mount is done. It does > > an assortment of housekeeping things, including a Renew op to make sure the > > lease doesn't expire. If for some reason the jail blocks these Renew RPCs, > > it will try to do them over and over and ... because having the lease > > expire is bad news for NFSv4. How could you tell? > > Well, capturing packets between the client and server, then looking at them > > in wireshark is probably the only way. (Or maybe a large count for Renew > > in the output from "nfsstat -e".) > > > > "nfscbd" is optional for NFSv4.0. Without it, you simply don't do > > callbacks/delegations. > > For NFSv4.1 it is pretty much required, but doesn't need a separate > > server->client TCP > > connection. > > --> I'd enable it for NFSv4.1, but disable it for NFSv4.0 at least as a > > starting point. > > > > And as I said before, none of this is tested within jails, so I have no > > idea > > what effect the jails have. Someone who understands jails might have some > > insight > > w.r.t. this? > > > > rick > > > > Since last time I haven't tried to use pnfs and just sticked with > nfsv4.0. nfscbd is not running. The server is now running 10.2. The > number of renews is not very high (56k, getattr is for example 283M) > View with wireshark, renew calls look good ,the nfs status is ok. > > Is there a way to know what [nfscl] is active with? > > I do understand nfs + jails could have issues, but I like to understand > them. > It is conceivable that this high load is caused by the problem identified in PR#205193, where jails can't talk to the nfsuserd because 127.0.0.1 gets translated to another ip address for the machine. The attached patches are the same ones as in the PR, which change the nfsuserd to use an AF_LOCAL socket instead. If it's convenient, it would be nice to try these patches (kernel + nfsuserd). rick ps: They are against head, so I'm not sure how easily they will apply to FreeBSD10. > > Frank > > _______________________________________________ > freebsd-stable@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org" > ------=_Part_133672613_387212164.1450225263919 Content-Type: text/x-patch; name=nfsuserd-aflocal-kern.patch Content-Disposition: attachment; filename=nfsuserd-aflocal-kern.patch Content-Transfer-Encoding: base64 LS0tIGZzL25mcy9uZnNfY29tbW9ua3JwYy5jLnNhdgkyMDE1LTEyLTEwIDIwOjAxOjM1LjQ4ODMx NzAwMCAtMDUwMAorKysgZnMvbmZzL25mc19jb21tb25rcnBjLmMJMjAxNS0xMi0xMCAyMDowNDo0 MC45MDM4NTQwMDAgLTA1MDAKQEAgLTE5OCw2ICsxOTgsOCBAQCBuZXduZnNfY29ubmVjdChzdHJ1 Y3QgbmZzbW91bnQgKm5tcCwgc3RyCiAJCQluY29uZiA9IGdldG5ldGNvbmZpZ2VudCgidWRwIik7 CiAJCWVsc2UKIAkJCW5jb25mID0gZ2V0bmV0Y29uZmlnZW50KCJ0Y3AiKTsKKwllbHNlIGlmIChz YWRkci0+c2FfZmFtaWx5ID09IEFGX0xPQ0FMKQorCQluY29uZiA9IGdldG5ldGNvbmZpZ2VudCgi bG9jYWwiKTsKIAllbHNlCiAJCWlmIChucnAtPm5yX3NvdHlwZSA9PSBTT0NLX0RHUkFNKQogCQkJ bmNvb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i0+c3VuX3BhdGgsCisJCQkgICAgc2l6ZW9mKHN1bi0+c3VuX3BhdGgpLCBOVUxMKTsKKwkJCWlm IChlcnJvciAhPSAwKSB7CisJCQkJZnJlZShzdW4sIE1fU09OQU1FKTsKKwkJCQlyZXR1cm4gKGVy cm9yKTsKKwkJCX0KKwkJICAgICAgICBzdW4tPnN1bl9mYW1pbHkgPSBBRl9MT0NBTDsKKwkJICAg ICAgICBzdW4tPnN1bl9sZW4gPSBTVU5fTEVOKHN1bik7CisJCQlzb2NrcG9ydCA9IDA7CisJCQlz YWQgPSAoc3RydWN0IHNvY2thZGRyICopc3VuOworCQl9IGVsc2UgeworCQkJZXJyb3IgPSBjb3B5 aW4odWFwLT5hcmdwLCAoY2FkZHJfdCkmc29ja3BvcnQsCisJCQkgICAgc2l6ZW9mICh1X3Nob3J0 KSk7CisJCQlzYWQgPSBOVUxMOworCQl9CisJCWlmIChlcnJvciA9PSAwKQorCQkJZXJyb3IgPSBu ZnNydl9uZnN1c2VyZHBvcnQoc2FkLCBzb2NrcG9ydCwgcCk7CiAJfSBlbHNlIGlmICh1YXAtPmZs YWcgJiBORlNTVkNfTkZTVVNFUkRERUxQT1JUKSB7CiAJCW5mc3J2X25mc3VzZXJkZGVscG9ydCgp OwogCQllcnJvciA9IDA7Cg== ------=_Part_133672613_387212164.1450225263919 Content-Type: text/x-patch; name=nfsuserd-aflocal.patch Content-Disposition: attachment; filename=nfsuserd-aflocal.patch Content-Transfer-Encoding: base64 LS0tIHVzci5zYmluL25mc3VzZXJkL25mc3VzZXJkLmMuc2F2CTIwMTUtMTItMDkgMTg6NDY6Mjku Mjg0OTcyMDAwIC0wNTAwCisrKyB1c3Iuc2Jpbi9uZnN1c2VyZC9uZnN1c2VyZC5jCTIwMTUtMTIt MTAgMjE6MzU6MTcuNTA1MzQzMDAwIC0wNTAwCkBAIC0zNSw2ICszNSw3IEBAIF9fRkJTRElEKCIk RnJlZUJTRDogaGVhZC91c3Iuc2Jpbi9uZnN1c2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