Pfsense mbuf full, what to do?

I noticed today that the MBUF usage has hit its limit. Apparently the site I'm running under pfsense is having some troubles too, I'd like to know if it would be safe to just

sysctl kern.ipc.nmbclusters=65536

I wouldn't like to reboot the server, is it safe (or useful) to do it via pfsense shell?

2.0-RELEASE (amd64) built on Tue Sep 13 17:05:32 EDT 2011

State table size    35573/550000
MBUF Usage    25600/25600
CPU usage 2%
Memory usage 17% (2GB)
Swap 0%
CPU: Intel(R) Xeon(R) CPU E5450 @ 3.00GHz

Changing (increasing) nmbclusters is safe -- you should be able to do this with no adverse effects.
Note however that you must also make the appropriate changes to /boot/loader.conf in order for the change to persist across reboots.

Also note that the kernel you are using may not allow you to change this value at runtime: Older versions of FreeBSD require you to set the value in /boot/loader.conf (and really ancient versions require the value to be compiled into the kernel).
If the sysctl command doesn't work you will have to edit /boot/loader.conf and reboot to make this change.


It is recommended to place kern.ipc.nmbclusters tweak in /boot/loader.conf.local rather than /boot/loader.conf (as suggested in @voretaq7's answer), because the latter one can get replaced during upgrade.

You can also adjust this variable via System Tunables (System > Advanced > System Tunables tab) inside pfSense web GUI.

The actual value for nmbclusters depends on the the number of network interfaces, CPU cores, and few other factors - a bit of experimenting is required to find the optimal value for each system.

Reference:

  • https://doc.pfsense.org/index.php/Tuning_and_Troubleshooting_Network_Cards
  • https://redmine.pfsense.org/issues/1221

::: PfSense 2.5 / 2021 Update :::

kern.ipc.nmbclusters must be added / tweaked in /boot/loader.conf.local
and it is NOT
available in the WebGUI at System Tunables (System > Advanced > System Tunables tab)