From owner-svn-src-all@FreeBSD.ORG Wed Oct 15 03:18:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D899F71; Wed, 15 Oct 2014 03:18:30 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 78C5CFC0; Wed, 15 Oct 2014 03:18:28 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s9F3IQsW077294 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 15 Oct 2014 07:18:26 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s9F3IQ4S077293; Wed, 15 Oct 2014 07:18:26 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 15 Oct 2014 07:18:26 +0400 From: Gleb Smirnoff To: Olivier =?iso-8859-1?Q?Cochard-Labb=E9?= Subject: Re: svn commit: r272906 - in head/sys: conf libkern netpfil/pf sys Message-ID: <20141015031826.GD73266@FreeBSD.org> References: <201410101926.s9AJQRY1049602@svn.freebsd.org> <20141015030455.GC73266@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20141015030455.GC73266@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head , "George V. Neville-Neil" , svn-src-all , src-committers X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Oct 2014 03:18:30 -0000 On Wed, Oct 15, 2014 at 07:04:55AM +0400, Gleb Smirnoff wrote: T> On Mon, Oct 13, 2014 at 06:42:11PM +0200, Olivier Cochard-Labbé wrote: T> O> > Author: gnn T> O> > Date: Fri Oct 10 19:26:26 2014 T> O> > New Revision: 272906 T> O> > URL: https://svnweb.freebsd.org/changeset/base/272906 T> O> > T> O> > Log: T> O> > Change the PF hash from Jenkins to Murmur3. In forwarding tests T> O> > this showed a conservative 3% incrase in PPS. T> O> T> O> It's not easy to measure 3% of difference ;-) T> T> However, it is easy to estimate distribution of a hash function. Also T> doing the calculation speed test along the way. T> T> I've got very disappointing results with this murmur3 against jenkins. T> I am running 87k states just taken from a live system against a 32k T> state hash table (which is a default size). T> T> Look at results at the end of email. Guess what -j and -m mean. I T> want either proving me doing the test wrong, or backing the change T> out ASAP. And now for a generate case, which actually is a practical case. We've got an internal load balancer, where all connections come from the same IPs, making the ports only being source of entropy. We've got 198k states there. And here are results: glebius@think:~/pf/hashtest:|>./hashtest -m ../node01.apps.keys Stat overflow: 144507 -> 99 Stat overflow: 53514 -> 99 Stat overflow: 517 -> 99 0 collisions 32761 hits 1 collisions 1 hits 2 collisions 1 hits 18 collisions 1 hits 44 collisions 1 hits >99 collisions 3 hits Read 198603 keys, found 362 keys in hash Execution time 6164622 nsec Yes, 144k collisions. Simply a linear search. Jenkins does good: glebius@think:~/pf/hashtest:|>./hashtest -j ../node01.apps.keys 0 collisions 69 hits 1 collisions 465 hits 2 collisions 1393 hits 3 collisions 2829 hits 4 collisions 4205 hits 5 collisions 5231 hits 6 collisions 5405 hits 7 collisions 4613 hits 8 collisions 3360 hits 9 collisions 2371 hits 10 collisions 1357 hits 11 collisions 774 hits 12 collisions 387 hits 13 collisions 177 hits 14 collisions 76 hits 15 collisions 42 hits 16 collisions 11 hits 17 collisions 3 hits Read 198603 keys, found 198603 keys in hash Execution time 18564948 nsec -- Totus tuus, Glebius.