From owner-freebsd-current@freebsd.org Sun May 19 09:06:36 2019 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A4B615A8682 for ; Sun, 19 May 2019 09:06:36 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D326E85AB5; Sun, 19 May 2019 09:06:35 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id SHm2h822gsAGkSHm4huj3c; Sun, 19 May 2019 03:06:32 -0600 X-Authority-Analysis: v=2.3 cv=WeVylHpX c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=IkcTkHD0fZMA:10 a=E5NmQfObTbMA:10 a=pGLkceISAAAA:8 a=hF2rLc1pAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=X82NJP_nnafa98COpx0A:9 a=SyP-ZA-YBFoE2mQf:21 a=VAZDA0AVHki2s70a:21 a=QEXdDO2ut3YA:10 a=O9OM7dhJW_8Hj9EqqvKN:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from [192.168.2.88] (unknown [142.118.169.171]) by spqr.komquats.com (Postfix) with ESMTPSA id A3B781D09; Sun, 19 May 2019 02:06:29 -0700 (PDT) Date: Sun, 19 May 2019 05:06:04 -0400 User-Agent: K-9 Mail for Android In-Reply-To: <20190519085501.GL2748@kib.kiev.ua> References: <20190519085501.GL2748@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: RFC w.r.t. toggling debugging on/off for mountd via a signal To: freebsd-current@freebsd.org, Konstantin Belousov , Rick Macklem CC: Alan Somers , "freebsd-current@FreeBSD.org" From: Cy Schubert Message-ID: <564922E3-7BE4-498B-871A-6152A0DF9AD4@cschubert.com> X-CMAE-Envelope: MS4wfEhqLr5zAPjqrcq/QkzPzP1R+dmrVMgpXXjfOA09OwbacD3kEDWKzDR4dDxwQDsb04e0XZ7ZEk2mYltkHht4Yi0OY+EKz/aVl1eGry+avMypDZmAAyP6 AOjZziRr4PHufOlZWUZ+lv5DwA65NJZjFd2egPxSkvuP5HwdUPLJqL7ImKgKsYSJnv0W6E+WxaVqJ5Y51wYnhrNo50QIwuoUEBn76usS8okPPfYncmwnoPGL l4GKwr6lq+o35oenNjqhENg90Aqi3lK4j7HTCcCw+wExcmfHiOWrxmAAVrYgIusN X-Rspamd-Queue-Id: D326E85AB5 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2019 09:06:36 -0000 On May 19, 2019 4:55:01 AM EDT, Konstantin Belousov = wrote: >On Sun, May 19, 2019 at 02:47:10AM +0000, Rick Macklem wrote: >> Alan Somers wrote: >> >On Sat, May 18, 2019 at 7:59 PM Rick Macklem >wrote: >> >> >> >> Hi, >> >> >> >> I've been working with Peter Errikson on a patch for mountd that >adds a new option >> >> for incremental updating of exports=2E This seems to be helping a >lot w=2Er=2Et=2E performance >> >> on an NFS server with lots (10000+) of exported file systems=2E >> >> >> >> I have debug syslog() calls in the code, which I/Peter think would >be worth keeping >> >> in the production code in case someone runs into problems with >this new option=2E >> >> >> >> As such, I'd like to have the code compiled in by default (not >only if DEBUG is defined, >> >> as mountd=2Ec has now)=2E I also was thinking it would be nice if th= e >daemon didn't need >> >> to be restarted to enable/disable the debugging output, since that >breaks NFS >> >> mounting during the restart=2E >> >> >> >> So, I was thinking of having the debugging output toggled on/off >via SIGUSR1=2E >> >> >> >> What do you think of this idea? >> >> Any other/better ways to do this? >> >> Also, would LOG_DAEMON and LOG_DEBUG sound like the correct >facility and >> >> priority for theses syslog() calls? >> >> >> >> Thanks in advance for any comments, rick >> > >> >If the debug messages aren't so verbose that they'll slow down >> >syslogd, then you can just leave them enabled all the time=2E syslogd >> >will filter them=2E However, if they're super-verbose then SIGUSR1 >> >sounds reasonable=2E I can't think of another daemon with runtime >> >selectable logging verbosity like that=2E >> Yes, these are pretty chatty=2E 5-10 lines for each entry in an exports >file=2E >> Multiply that times the number of entries=2E (Peter's servers are >between 20000 >> to 72000+ file systems=2E Not sure if he has multiple entries/file >system=2E) >>=20 >> To give you a clue, without this patch, it can take 20sec->over 1min >to reload them >> when mountd gets a SIGHUP=2E >>=20 >> It's just that the export file handling code is pretty convoluted, so >I think the patch >> is ok, but I won't be too surprised if someone finds a problem=2E > >Instead of toggling the debugging by SIGUSR1, you can make the daemon >to try to open some file by receiving the normal reload signal, e=2Eg=2E >/var/run/mountd=2Edebug=2E If the file is present, the debugging is >enabled=2E >The advantage is that the user knows what is the debugging state, >instead >of requiring to count the number of sent SIGUSR1's=2E > >More, in traditions of malloc(3), /var/run/mountd=2Edebug could be a >symlink, >which is read and interpreted as some options controlling the debug=2E >_______________________________________________ >freebsd-current@freebsd=2Eorg mailing list >https://lists=2Efreebsd=2Eorg/mailman/listinfo/freebsd-current >To unsubscribe, send any mail to >"freebsd-current-unsubscribe@freebsd=2Eorg" Instead of syslog() calls, DTrace probes are designed for this type of ins= trumentation=2E=20 --=20 Pardon the typos and autocorrect, small keyboard in use=2E Cheers, Cy Schubert FreeBSD UNIX: Web: http://www=2EFreeBSD=2Eorg The need of the many outweighs the greed of the few=2E