The Handbook

    Theme
    • Guides
        • Check a system before installing FreeBSD
        • Orient a Linux administrator on FreeBSD
        • Supported FreeBSD releases
        • Choose a FreeBSD documentation and support channel
        • Move files safely without GNU mv -t
        • Update, upgrade, or update packages?
        • Upgrade 14.4 or 15.0 to FreeBSD 15.1
        • Choose packages, ports, or poudriere
        • Choose the quarterly or latest package branch
        • Choose a FreeBSD download or package mirror
        • Make a system setting persistent
        • Configure locale, keyboard, and time zone
        • Configure a serial console for recovery
        • Choose a custom kernel, module, or loader setting
        • Run a Linux binary with the compatibility layer
        • Check desktop and laptop hardware before installation
        • Choose and check a graphics driver
        • Choose Xorg or Wayland
        • Build a maintainable desktop baseline
        • Install and check a desktop browser
        • Check laptop Wi-Fi, power, and suspend
        • Check multimedia readiness
        • Choose and configure a printing stack
        • Run Windows applications with Wine
        • Snapshot and replicate a ZFS dataset
        • Choose a filesystem and storage layout
        • Operate ZFS without losing the recovery path
        • Restore files from a ZFS snapshot
        • Read ZFS pool health and run a scrub
        • Replace a failed device in a ZFS mirror
        • Replicate a ZFS dataset over SSH
        • Change PF safely on a remote host
        • Configure a narrow WireGuard tunnel
        • Plan a FreeBSD home server
        • Choose a mail server or an outgoing relay
        • Publish a network service safely
        • Choose a jail network model
        • Choose native jails or a jail manager
        • Choose a jail or a bhyve virtual machine
        • Establish a FreeBSD security baseline
        • Choose a MAC policy
        • Audit security-relevant activity
        • Start a DTrace performance investigation
    • Integrations
        • Create a first jail with Bastille
        • Compare jail managers and OCI tooling
        • Publish a Bastille service through PF
        • Mount a ZFS dataset in a Bastille jail
        • Update and upgrade Bastille jails
        • Back up and restore a Bastille jail
        • Prepare bhyve and vm-bhyve
        • Choose NFS or Samba for file sharing
        • Choose ZFS backup automation
        • Operate a signed poudriere repository
        • Manage FreeBSD configuration with Ansible or Salt
        • Run Motion with webcamd on FreeBSD
        • Design a reverse proxy, certificates, and monitoring
    • FAQ
      • Troubleshooting
          • Recover an interrupted freebsd-update run
          • Resolve a package repository or ABI mismatch
          • Diagnose the FreeBSD boot path
          • Recover with a ZFS boot environment
          • Diagnose DNS, routing, and firewall paths
          • Diagnose network mbuf exhaustion
          • Bind a service to a low port without running it as root
          • Diagnose audio output or input
          • Diagnose webcamd, cuse, and a webcam
          • Fix USB device permissions without opening every device
      • About this handbook
      • Synopsis
      • Capture evidence before changing anything
      • Interpret the counters
      • Relate pressure to the workload
      • Plan a loader-tunable change
      • Verify the result
      • Primary references

      Diagnose network mbuf exhaustion

      Last reviewed
      13 August 2026
      Applies to
      15.1-RELEASE, 15.0-RELEASE, 14.4-RELEASE

      Synopsis #

      FreeBSD uses mbufs and several cluster sizes for network data. The kern.ipc.nmbclusters loader tunable limits one of those pools. A timeout, slow transfer, dropped packet, or busy firewall does not by itself show that the limit is too low.

      Diagnose mbuf exhaustion from allocation counters collected during the failing workload. Change the loader tunable only when the relevant cluster limit is reached and denied or delayed requests increase with the incident. An arbitrary large value can reserve excessive kernel memory or prevent a successful boot.

      Capture evidence before changing anything #

      Record the release, uptime, configured limit, and complete mbuf report:

      $ freebsd-version -kru
      $ uptime
      $ sysctl kern.ipc.nmbclusters
      $ netstat -m
      

      netstat -m reports current, cached, total, and maximum counts for ordinary and jumbo clusters. It also reports denied and delayed allocation requests separately for mbufs, clusters, combined mbuf-and-cluster objects, and jumbo clusters.

      Save one report before the workload, another while the failure is reproducible, and a third after it subsides. The counters are more useful as a change over the observation interval than as an isolated number.

      Interpret the counters #

      Evidence of ordinary mbuf-cluster exhaustion normally has all of these properties:

      • ordinary cluster use approaches its reported maximum;
      • the cluster or combined allocation-denial counter increases during the incident;
      • the increase coincides with an application error, packet loss, or throughput collapse;
      • reducing the workload stops the increase.

      A nonzero denial counter in one later snapshot proves that a denial occurred, but not that it caused the present failure. A high-water mark near the maximum is also insufficient when current use has fallen and denial counters remain unchanged.

      The counter category matters. A jumbo-cluster denial, an sfbuf shortage, a full socket listen queue, and an ordinary cluster denial are different resource limits. Raising kern.ipc.nmbclusters is not a demonstrated correction for every line in netstat -m.

      When the denial counters remain unchanged, continue with Diagnose DNS, routing, and firewall paths . Interface errors, route selection, PF state, socket queues, and application limits can produce similar symptoms without exhausting network memory.

      Relate pressure to the workload #

      Repeat the observation with one controlled change in load. Record at least:

      • concurrent connections and expected socket-buffer sizes;
      • traffic rate and packet size;
      • enabled firewalls, bridges, jails, VPNs, and packet-capture processes;
      • the exact netstat -m counter that grows;
      • available physical memory and other kernel-memory consumers.

      This record provides a basis for capacity planning. It also prevents a larger pool from hiding an unbounded connection leak or an unexpectedly amplified traffic path.

      Plan a loader-tunable change #

      kern.ipc.nmbclusters is set by the boot loader and cannot be safely evaluated as an ordinary writable runtime sysctl. Derive a proposed limit from measured peak use, observed denied allocations, expected growth, and the host’s memory budget. There is no release-independent value suitable for every firewall, storage server, hypervisor, or desktop.

      After review, place the single assignment in /boot/loader.conf and schedule a reboot with console access. The assignment has the form kern.ipc.nmbclusters="value", where value is the reviewed numeric limit rather than a copied example. See Make a system setting persistent for the distinction between loader tunables and runtime sysctls.

      Preserve the previous file and record the exact rollback before rebooting. At the loader prompt, a problematic override can be bypassed for one boot:

      unset kern.ipc.nmbclusters
      boot
      

      After the system starts, remove or correct the assignment in /boot/loader.conf before the next reboot.

      Verify the result #

      After reboot, confirm the active limit and repeat the same workload and observation interval:

      $ sysctl kern.ipc.nmbclusters
      $ netstat -m
      

      Success means that the relevant denial counter no longer increases under the accepted workload, memory remains within the planned budget, and the original application-level failure is absent. A larger displayed maximum alone is not an acceptance test.

      Primary references #

      • netstat(1)
      • mbuf(9)
      • loader_simp(8)
      • loader.conf(5)
      • FreeBSD Handbook: Configuration, Services, Logging and Power Management

      Independent documentation. Not affiliated with or endorsed by the FreeBSD Project or the FreeBSD Foundation.

      Report a bug
      • Synopsis
      • Capture evidence before changing anything
      • Interpret the counters
      • Relate pressure to the workload
      • Plan a loader-tunable change
      • Verify the result
      • Primary references