From owner-freebsd-arch@FreeBSD.ORG Thu Nov 29 10:36:33 2012 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A431EF9E; Thu, 29 Nov 2012 10:36:33 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 6260F8FC08; Thu, 29 Nov 2012 10:36:32 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id C87958D1; Thu, 29 Nov 2012 11:34:40 +0100 (CET) Date: Thu, 29 Nov 2012 11:37:52 +0100 From: Pawel Jakub Dawidek To: Robert Watson Subject: Re: Print a (rate-limited) warning when UMA zone is full. Message-ID: <20121129103752.GD1370@garage.freebsd.pl> References: <20121129090147.GB1370@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="RhUH2Ysw6aD5utA4" Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-arch@FreeBSD.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 10:36:33 -0000 --RhUH2Ysw6aD5utA4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 29, 2012 at 10:30:07AM +0000, Robert Watson wrote: >=20 > On Thu, 29 Nov 2012, Pawel Jakub Dawidek wrote: >=20 > > I'd like to propose the following patch: > > > > http://people.freebsd.org/~pjd/patches/uma_warning.patch > > > > When UMA zone is created, one can add configure a warning that should b= e=20 > > printed when UMA zone is full by calling: > > > > uma_zone_set_warning(socket_zone, > > "kern.ipc.maxsockets limit exceeded, please see tuning(7)."); > > > > It was very easy to find and fix the problem when I saw messages on the= =20 > > console that kern.maxfiles limit is reached, but when I hit=20 > > kern.ipc.maxsockets limit and started to get ENOBUFS errors it took me = a=20 > > while to figure out what to tune. > > > > This patch allows to configure advice for the use and give him some det= ails=20 > > in a very easy way. The warning printed on the console is rate-limited = to=20 > > one per second. >=20 > Just to follow up on some out-of-band communication -- this is a good ide= a,=20 > but there was some concern about printf() under mutexes. I'm not actuall= y=20 > that concerned about that case (we do it quite a lot for warnings and ker= nel=20 > debugging), but it might be useful to consider using log() instead, so th= at it=20 > ends up in the system log as well as on the console. I'm happy with using log(9), but currently when log(9) is used, the message is not printed on the console, it only ends up in the system log. printf(9) on the other hand is printed on the console and is appended to the system logs. The only case where log(9) will actually log to the console, AFAIR, is when syslogd is not working. > For I while I've wondered if we need a spp to complement pps -- that is,= =20 > limiting printf()s to every (n) seconds, rather than (n) per second. For= =20 > tunable warnings like this, it would be nice to limit them to once a minu= te or=20 > similar. Or change pps to ppm. I agree that getting these warning every second is too aggressive. > Finally, we should make sure that in all instances where we point at=20 > tuning(7), it has something useful to say about the topic :-). Yes, I am aware the warnings proposed in the patch are a bit too optimistic:) --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --RhUH2Ysw6aD5utA4 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlC3OwAACgkQForvXbEpPzQfigCfWcBL+1DTzY0w9Co2AWNZnjDs LNkAoK53E5T30vGbsIRdJhC7lV3tQcZ9 =N8rI -----END PGP SIGNATURE----- --RhUH2Ysw6aD5utA4--