Zoneli - Zonelimit State

Problem Explained

When there are no free mbuf clusters available, FreeBSD enters zonelimit state and stops awnsering network requests. You can see if the system has gone into “zoneli” state by using the top command.

To see current mbuf cluster usage

netstat -m

Resolution

Immediate resolution is to reboot the system. System may not recover from zoneli state by killing affected processes. Sometimes even a reboot will not work from console and machine will need to power cycled.

Update Settings on /boot/loader.conf

kern.ipc.nmbclusters="2147483647"
kern.ipc.somaxconn="1024"
kern.ipc.maxsockbuf="20480000"
net.inet.tcp.sendspace="1024000"
net.inet.tcp.recvspace="1024000"

OR

Following is the run time updating settings.

sysctl kern.ipc.nmbclusters=2147483647
sysctl kern.ipc.somaxconn=1024
sysctl kern.ipc.maxsockbuf=20480000
sysctl net.inet.tcp.sendspace=1024000
sysctl net.inet.tcp.recvspace=1024000