Pfsense mbuf full, what to do?
Solution 1
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.
Solution 2
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
Solution 3
::: 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)
Related videos on Youtube
sathia
I like fast and cheap solutions. it has to work wether it's clean or not.
Updated on September 18, 2022Comments
-
sathia almost 2 years
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
-
sathia over 12 yearsMBUF Usage 25600/65536, thanks for your help, apparently it's all right! I will post here if I see any problem or unexpected condition. have a good day.
-
Philip over 12 years@sathia Be careful not to set the limit too high, failed mallocs in kernel space tend to end in dump screens (65k on a server with 2GB RAM is safe, just don't pick an outrageous number). Also, the value can not be decreased; take a reboot to lower the running max.
-
sathia over 12 years@ChrisS Hi, Yes, of course I've read what would be a good amount of nbclusters with 2 GB and apparently the sweet spot is 65k. thanks though. So far so good, I've seen a sensible increase in traffic. even if it's only using 26030/65536. thanks for your help, it's appreciated.