NAT performance tweaks

Clement Laforet sheep.killer at cultdeadsheep.org
Wed May 7 10:19:09 PDT 2003


> 
> Would certainly be nice to make it as a sysctl. It's a pain in the ass to
> edit it manually everytime I cvsup. :/
> 

You can surely define NAT_SIZE and others in your make.conf.

#ifndef NAT_SIZE
# define        NAT_SIZE        127
#endif
#ifndef RDR_SIZE
# define        RDR_SIZE        127
#endif
#ifndef HOSTMAP_SIZE
# define        HOSTMAP_SIZE    127
#endif
#ifndef NAT_TABLE_SZ
# define        NAT_TABLE_SZ    127
#endif

but don't define LARGE_NAT 
ie : 

#ifdef  LARGE_NAT
#undef  NAT_SIZE
#undef  RDR_SIZE
#undef  NAT_TABLE_SZ
#undef  HOSTMAP_SIZE    127
#define NAT_SIZE        2047
#define RDR_SIZE        2047
#define NAT_TABLE_SZ    16383
#define HOSTMAP_SIZE    8191
#endif

You should use prime numbers to have a better hash :-)

clem


More information about the freebsd-performance mailing list