From owner-freebsd-net@FreeBSD.ORG Fri Jul 12 09:57:55 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1C504548; Fri, 12 Jul 2013 09:57:55 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id D32741AD1; Fri, 12 Jul 2013 09:57:54 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 7D9167300A; Fri, 12 Jul 2013 11:53:22 +0200 (CEST) Date: Fri, 12 Jul 2013 11:53:22 +0200 From: Luigi Rizzo To: Gleb Smirnoff Subject: Re: Listen queue overflow: N already in queue awaiting acceptance Message-ID: <20130712095322.GA94049@onelab2.iet.unipi.it> References: <51DE591E.7040405@FreeBSD.org> <51DE5C8C.3090404@freebsd.org> <20130711133504.GB67810@FreeBSD.org> <51DEC10B.3080409@freebsd.org> <51DEC992.2040902@FreeBSD.org> <51DED28D.80502@freebsd.org> <20130712082527.GC8839@glebius.int.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130712082527.GC8839@glebius.int.ru> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-net@freebsd.org, Andre Oppermann , Andriy Gapon X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jul 2013 09:57:55 -0000 On Fri, Jul 12, 2013 at 12:25:27PM +0400, Gleb Smirnoff wrote: > On Thu, Jul 11, 2013 at 05:43:09PM +0200, Andre Oppermann wrote: ... > A> I'm currently looking into a) applying a rate limiter to the message (as suggested > A> by Luigi); and b) add a per-socket accept queue overflow statistic that is visible > A> via netstat. I'll post patches for testing when done. > > What about the following generic idea: syslogd periodically queries the kernel > about various error counters, and remembers the values. Those, that increased since > previous query are logged. > > This can be implemented in different ways, either syslogd knows all the sysctls, > or kernel "pushes" a list of values to syslogd. These are details to be discussed. > > What do you think about the plan itself? good idea in principle as it enables global throttling of messages and reduces the overhead ih the error path. However sounds complex in practice, as counters can be created dynamically (sysctl_add*() and friends), and are spread all over the place and with different methods. So the "pull" model (sysctl performs a scan to request values) will perform poorly. Just think of how expensive is to try and pull all the unchanged counters. Gleb, what is your intended goal ? global throttling ? this can probably be implemented still using the push model, with a variations of the macros I proposed (and some machinery to make sure that messages do not starve because someone else is taking up all the space; that is basically a trivial scheduler) delegating the sprintf to sysctl ? that is harder i believe, because you'd need some way to store the values used to build the message. cheers luigi > -- > Totus tuus, Glebius. > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"