Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Apr 2003 20:54:31 -0800 (AKDT)
From:      jonr@destar.net
To:        freebsd-questions@freebsd.org
Subject:   Re: mbufs exhausted
Message-ID:  <1438.192.168.1.1.1049864071.squirrel@www.destar.net>
In-Reply-To: <20030409034713.GC650@gothmog.gr>
References:  <1049817201.1588.30.camel@localhost.localdomain> <20030409034713.GC650@gothmog.gr>

next in thread | previous in thread | raw e-mail | index | archive | help
> On 2003-04-08 07:53, Jon Reynolds <jonr@destar.net> wrote:
>> I am getting the message "mbufs exhausted please see tuning". So, I
>> saw tuning. What file can you change the mbufs in? I remeber it being
>> in /etc but not which config file it was.
>>
>> Also, would adding 'NMBCLUSTERS=4096' to the end of my kernel be ok?
>> Whats the highest value I can set this too? I found inside of 'LINT'
>> that mbufs would size itself 4x that of 'NMBCLUSTERS' if the NMBUFS
>> option is not specified. So would this help the errors that I am
>> getting?
>
> Each packet that is received from or sent by your FreeBSD kernel is
> stored while in transit in one or more "mbufs".  You can see how many
> are in use any time with sysctl and netstat:
>
>     $ sysctl -a | grep nmbufs
>     kern.ipc.nmbufs: 34432
>
>     $ sysctl -a | grep nmbcl
>     kern.ipc.nmbclusters: 17216
>
>     $ netstat -m
>     mbuf usage:
>             GEN cache:      0/0 (in use/in pool)
>             CPU #0 cache:   25/64 (in use/in pool)
>             Total:          25/64 (in use/in pool)
>             Mbuf cache high watermark: 512
>             Mbuf cache low watermark: 128
> -->         Maximum possible: 34432
>             Allocated mbuf types:
> -->           25 mbufs allocated to data
>             0% of mbuf map consumed
>     mbuf cluster usage:
>             GEN cache:      0/0 (in use/in pool)
>             CPU #0 cache:   0/64 (in use/in pool)
>             Total:          0/64 (in use/in pool)
>             Cluster cache high watermark: 128
>             Cluster cache low watermark: 16
> -->         Maximum possible: 17216
>             0% of cluster map consumed
>     144 KBytes of wired memory reserved (4% in use)
>     0 requests for memory denied
>     0 requests for memory delayed
>     0 calls to protocol drain routines
>
> It's easy to see that kern.ipc.nmbufs is reported by netstat as the
> "maximum possible" value for allocated mbufs, while the value of the
> kern.ipc.nmbclusters sysctl is reported as the "maximum possible"
> number of mbuf clusters.
>
> The size of an mbuf is very small when compared to the size of an "mbuf
> cluster".  If the output of netstat shows that you're running out of
> mbufs but not out of clusters you should only increase NMBUFS.  If
> they're both running out, you should probably increase NMBCLUSTERS and
> let NMBUFS pick up the change from there.
>
> - Giorgos

Thanks Giorgos,

  I did as you suggested and both nmbclusters and nmbufs were maxed out,
well nmbclusters was about 3 clusters shy of maxxing out. I went into my
/boot/defaults/loader.conf and changed the nmbclusters to =4096 and
rebooted. Should this setting have been added to the kernel and
recompiled or is setting it in the loader.conf alright also?

Thanks again,

Jon





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1438.192.168.1.1.1049864071.squirrel>