Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Nov 2012 08:28:02 +0100
From:      Andre Oppermann <oppermann@networx.ch>
To:        Alfred Perlstein <bright@mu.org>
Cc:        freebsd-net@freebsd.org, Adrian Chadd <adrian@freebsd.org>, Peter Wemm <peter@wemm.org>
Subject:   Re: auto tuning tcp
Message-ID:  <50A0A502.1030306@networx.ch>
In-Reply-To: <50A0A0EF.3020109@mu.org>
References:  <50A0A0EF.3020109@mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 12.11.2012 08:10, Alfred Perlstein wrote:
> I noticed that TCBHASHSIZE does not autotune.
>
> What do you think of the following algorithm?
>
> Basically round down to next power of two based on nmbclusters / 64.

Please wait out for a real fix of the various mbuf-whatever tuning
issue I'll propose shortly.  This approach may become inapproriate.
Also the mbuf limits can be changed at runtime by sysctl.

-- 
Andre

> -Alfred
>
> #include <stdio.h>
> #include <string.h>
> #include <stdlib.h>
>
>
> int
> main(int argc, char **argv)
> {
>          int nmbclusters;
>          int pow2cl;
>
>          nmbclusters = atoi(argv[1]);
>          pow2cl = 1 << (fls(nmbclusters / 64)-1);
>          if (pow2cl < 512)
>                  pow2cl = 512;
>          printf("%d\n", pow2cl);
>          return (0);
>
> }
>
> _______________________________________________
> 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"
>
>




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50A0A502.1030306>