Hi All, Mysql service is going down continously in my system due to lack of memory space. I checked the messages log and found the following error message. All mbuf clusters exhausted, please see tuning(7). I have no idea about mbuf cluster. Can anyone please help me to fix the issue. I hope the information below will help you. Following is the output of top. last pid: 84718; load averages: 2.56, 2.29, 2.55 up 2+03:59:04 13:27:58 195 processes: 2 running, 193 sleeping CPU states: 26.2% user, 0.0% nice, 10.0% system, 5.0% interrupt, 58.8% idle Mem: 1912M Active, 995M Inact, 421M Wired, 132M Cache, 199M Buf, 27M Free Swap: 2048M Total, 34M Used, 2014M Free, 1% Inuse Following is the output of netstat -m 3797/14672/26624 mbufs in use (current/peak/max): 3791 mbufs allocated to data 2 mbufs allocated to fragment reassembly queue headers 4 mbufs allocated to socket names and addresses 3704/6656/6656 mbuf clusters in use (current/peak/max) 16980 Kbytes allocated to network (85% of mb_map in use) 106522 requests for memory denied 1545 requests for memory delayed 0 calls to protocol drain routines Please let me know if you need more info regarding this. Thank you in advance. -- With Regards, Akhthar Parvez.K System Administrator Bangalore. --------------------- NOTHING IS IMPOSSIBLE Because Impossible itself says I'M POSSIBLE
Hi there, Am Mittwoch, 24. November 2004 19:32 schrieb Akhthar Parvez. K:> All mbuf clusters exhausted, please see tuning(7).Did you have a look at this ?> 3704/6656/6656 mbuf clusters in use (current/peak/max) > 16980 Kbytes allocated to network (85% of mb_map in use) > 106522 requests for memory denied > 1545 requests for memory delayedtuning(7): kern.ipc.nmbclusters may be adjusted to increase the number of network mbufs the system is willing to allocate. Each cluster represents approx- imately 2K of memory, so a value of 1024 represents 2M of kernel memory reserved for network buffers. You can do a simple calculation to figure out how many you need. If you have a web server which maxes out at 1000 simultaneous connections, and each connection eats a 16K receive and 16K send buffer, you need approximately 32MB worth of network buffers to deal with it. A good rule of thumb is to multiply by 2, so 32MBx2 = 64MB/2K 32768. So for this case you would want to set kern.ipc.nmbclusters to 32768. We recommend values between 1024 and 4096 for machines with mod- erates amount of memory, and between 4096 and 32768 for machines with greater amounts of memory. Under no circumstances should you specify an arbitrarily high value for this parameter, it could lead to a boot-time crash. The -m option to netstat(1) may be used to observe network clus- ter use. Older versions of FreeBSD do not have this tunable and require that the kernel config(8) option NMBCLUSTERS be set instead. greetings -- Thomas Eisenbarth eisenbarth@domecon.de Donau-Ries Media-Consulting http://www.domecon.de -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-security/attachments/20041124/7365ea5d/attachment.bin
Akhthar Parvez. K wrote:> Hi All, > > Mysql service is going down continously in my system due to lack of memory > space. > > I checked the messages log and found the following error message. > > All mbuf clusters exhausted, please see tuning(7). > > I have no idea about mbuf cluster. Can anyone please help me to fix the issue. > > I hope the information below will help you.[..snip..]> Following is the output of netstat -m > > 3797/14672/26624 mbufs in use (current/peak/max): > 3791 mbufs allocated to data > 2 mbufs allocated to fragment reassembly queue headers > 4 mbufs allocated to socket names and addresses > 3704/6656/6656 mbuf clusters in use (current/peak/max) > 16980 Kbytes allocated to network (85% of mb_map in use) > 106522 requests for memory denied > 1545 requests for memory delayed > 0 calls to protocol drain routines > > Please let me know if you need more info regarding this. > Thank you in advance.This isn't really security related, more performance related, so I'm moving it to that list (freebsd-performance@). The answer to your question is right in your email! In the tuning man page, it says: kern.ipc.nmbclusters may be adjusted to increase the number of network mbufs the system is willing to allocate. Each cluster represents approx- imately 2K of memory, so a value of 1024 represents 2M of kernel memory reserved for network buffers. You can do a simple calculation to figure out how many you need. If you have a web server which maxes out at 1000 simultaneous connections, and each connection eats a 16K receive and 16K send buffer, you need approximately 32MB worth of network buffers to deal with it. A good rule of thumb is to multiply by 2, so 32MBx2 = 64MB/2K 32768. So for this case you would want to set kern.ipc.nmbclusters to 32768. We recommend values between 1024 and 4096 for machines with mod- erates amount of memory, and between 4096 and 32768 for machines with greater amounts of memory. Under no circumstances should you specify an arbitrarily high value for this parameter, it could lead to a boot-time crash. The -m option to netstat(1) may be used to observe network clus- ter use. Older versions of FreeBSD do not have this tunable and require that the kernel config(8) option NMBCLUSTERS be set instead. More and more programs are using the sendfile(2) system call to transmit files over the network. The kern.ipc.nsfbufs sysctl controls the number of file system buffers sendfile(2) is allowed to use to perform its work. This parameter nominally scales with kern.maxusers so you should not need to modify this parameter except under extreme circumstances. See the TUNING section in the sendfile(2) manual page for details. So basically you need to use sysctl to adjust (increase) the kern.ipc.nmbclusters number. Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology When in doubt, mumble; when in trouble, delegate; when in charge, ponder ------------------------------------------------------------------------