auto tuning tcp

Alfred Perlstein bright at mu.org
Mon Nov 12 07:10:39 UTC 2012


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

}



More information about the freebsd-net mailing list