Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 01 Aug 2003 14:22:10 -0700
From:      Steve Francis <steve@expertcity.com>
To:        Mike Silbersack <silby@silby.com>
Cc:        freebsd-net@freebsd.org
Subject:   Re: mbuf clusters exhausted w/o reaching max?
Message-ID:  <3F2ADA02.7050304@expertcity.com>
In-Reply-To: <20030801152510.J2165@odysseus.silby.com>
References:  <3F2AC3F5.3010804@expertcity.com> <20030801152510.J2165@odysseus.silby.com>

next in thread | previous in thread | raw e-mail | index | archive | help
THanks for the reply... Question below.
Mike Silbersack wrote:

>Mbufs & mbuf clusters are allocated from the kernel map, so it's possible
>for allocations to fail due to the kernel map being relatively full due to
>other parts of the kernel eating memory.  This is probably what's
>happening in your case; given that only 50 allocations were denied, it
>probably didn't hurt your system much.
>
>Note that the kernel map is not the size of all ram; it's usually only 1/4
>of the amount of ram available, with a ceiling of 256MB.  You could try
>playing with those parameters, but you'll probably end up causing other
>problems in the process.  :)
>
 From LINT (see below),  the comment says the VM_KMEM_SIZE_MAX is 200M, 
yet the option says 100M.  Comment typo, or typo in the option?
Is increasing the VM_KMEM_SIZE_MAX (which should take us to up to 256M 
given 1G RAM) sufficient to allow extra space for mbuf clusters?

I googled and found this from das@freebsd.org on a related question:
"Within the kernel's share of this address space, memory is split into 
submaps, such as the mb_map (for the network), buffer_map for the 
filesystem buffer cache, and the kmem_map for just about everything 
else. These submaps are size-limited to prevent any one of them from 
getting out of hand."
I presume I need to increase mb_map, but could not find a specific 
option for that. Does that scale with an increased VM_KMEM_SIZE_MAX?

These servers basically run one process, which is about 500M resident 
and total size, on 1G RAM machine, and do tons of network IO with lots 
of packets.  Given that, do you still anticipate " causing other 
problems in the process" if I tune this?


Thanks



# Tune the kernel malloc area parameters.  VM_KMEM_SIZE represents the
# minimum, in bytes, and is typically (12*1024*1024) (12MB).
# VM_KMEM_SIZE_MAX represents the maximum, typically 200 megabytes.
# VM_KMEM_SIZE_SCALE can be set to adjust the auto-tuning factor, which
# typically defaults to 4 (kernel malloc area size is physical memory
# divided by the scale factor).
#
options         VM_KMEM_SIZE="(10*1024*1024)"
options         VM_KMEM_SIZE_MAX="(100*1024*1024)"
options         VM_KMEM_SIZE_SCALE="4"




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