Revision 79c2e54a
Added by Scott Ullrich about 16 years ago
etc/inc/filter.inc | ||
---|---|---|
58 | 58 |
else |
59 | 59 |
$maxstates = "150000"; |
60 | 60 |
// nmbflows cpu count * ($maxstates * 2) |
61 |
$cpus = trim(`sysctl kern.smp.cpus | cut -d' ' -f2`);
|
|
61 |
$cpus = trim(`/usr/sbin/sysctl kern.smp.cpus | /usr/bin/cut -d' ' -f2`);
|
|
62 | 62 |
$nmbflows = ($cpus*($maxstates*2)); |
63 |
if(!file_exists("/boot/loader.conf")) |
|
64 |
touch("/boot/loader.conf"); |
|
65 |
$loader_conf_nmbflows = trim(`cat /boot/loader.conf | grep flowtable_size | cut -d'=' -f2`); |
|
66 |
if($loader_conf_nmbflows <> $nmbflows) { |
|
67 |
$loader_conf = trim(`cat /boot/loader_conf | grep -v nmbflows`); |
|
68 |
$loader_conf .= "\nnet.inet.ip.output_flowtable_size={$nmbflows}\n"; |
|
69 |
file_put_contents("/boot/loader.conf", $loader_conf); |
|
70 |
} |
|
71 | 63 |
// Is flowtable enabled? |
72 | 64 |
if($config['system']['flowtable']) |
73 | 65 |
$flowtable_enable = 1; |
... | ... | |
75 | 67 |
$flowtable_enable = 0; |
76 | 68 |
// Flowtable currently only works on 8.0 |
77 | 69 |
if(get_freebsd_version() == "8") { |
78 |
if($flowtable_enable == 1) |
|
70 |
if($flowtable_enable == 1) {
|
|
79 | 71 |
mwexec("/usr/sbin/sysctl net.inet.flowtable.nmbflows={$config['system']['maximumstates']}"); |
72 |
mwexec("/usr/sbin/sysctl net.inet.ip.output_flowtable_size={$nmbflows}"); |
|
73 |
} |
|
80 | 74 |
mwexec("/usr/sbin/sysctl net.inet.flowtable.emable={$flowtable_enable}"); |
81 | 75 |
} |
82 | 76 |
} |
usr/local/www/system_advanced_network.php | ||
---|---|---|
255 | 255 |
<strong>Enable flowtable support</strong><br> |
256 | 256 |
Enables infrastructure for caching flows as a means of accelerating L3 and L2 lookups |
257 | 257 |
as well as providing stateful load balancing when used with RADIX_MPATH.<br/> |
258 |
<b>NOTE:</b> If you change the state limit with flowtable enabled, you must reboot pfSense for the flowtable changes to take effect. |
|
259 | 258 |
</td> |
260 | 259 |
</tr> |
261 | 260 |
<?php endif; ?> |
Also available in: Unified diff
Oops, we do not need to reboot to set nmbflows