On Tue, 21 May 2002, Scott Hess wrote:

> Setup: 2x SMP server running FreeBSD4.5.  Apache 1.3.x.  2Gig of memory.
>
> When stress-testing, I am able to cause the kernel messages:
>
>     m_clalloc failed, consider increase NMBCLUSTERS value
>     fxp0: cluster allocation failed, packet dropped!
>
> Here's my theory: When the amount of space used for user processes and
> kernel usage fills all of memory, and a burst of packets are received from
> the backend servers, the kernel isn't able to allocate pages and drops the
> packets, with the message.  The sender resends, and things cascade away.
> Since this is a kernel vm issue, the console also locks up.  [Well, it's
> the best I have.]
>
> I've tried upping vm.v_free_min, vm.v_free_target, and vm.v_free_reserved.
> It doesn't appear to have any impact.

I think that your theory is probably close to what is happening.
Unfortunately, there's no easy way to address this yet.  Due to the
extensive use of zone allocators in 4.x, it's hard to size all allocations
correctly.  For this reason, there may be other subtle issues with 2 gig+
machines.

For now, I think your best option may be to run your mbuf allocation
program so that you have a certain amount of mbufs allocated and ready for
your application.  Along those lines, you might consider writing a kernel
patch which performs this function based on a configurable value; I would
be happy to commit such a feature if it was implemented well; other people
with busy servers might find it useful.

I've been pondering various methods to handle out of mbuf cluster
situations better, but handling your case seems especially difficult.
I'll have to think more.

Mike "Silby" Silbersack


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-net" in the body of the message

Reply via email to