Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Nov 2012 23:10:39 -0800
From:      Alfred Perlstein <bright@mu.org>
To:        freebsd-net@freebsd.org, Peter Wemm <peter@wemm.org>,  Adrian Chadd <adrian@freebsd.org>
Subject:   auto tuning tcp
Message-ID:  <50A0A0EF.3020109@mu.org>

next in thread | raw e-mail | index | archive | help
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.

-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);

}




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