Re: Mbuf errors

From: Eric Anderson (anderson_at_centtech.com)
Date: 11/24/04

  • Next message: Nielsen: "Re: 100.chksetuid in /etc/periodic/security resets the mashine"
    Date: Wed, 24 Nov 2004 13:16:58 -0600
    To: akhthar@carmatec.com
    
    

    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
    ------------------------------------------------------------------------
    _______________________________________________
    freebsd-security@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-security
    To unsubscribe, send any mail to "freebsd-security-unsubscribe@freebsd.org"
    

  • Next message: Nielsen: "Re: 100.chksetuid in /etc/periodic/security resets the mashine"

    Relevant Pages

    • Re: Mbuf cluster allocation failed Error
      ... 324/756/8704 mbuf clusters in use ... requests for memory delayed ... I have changed the maxuser statement end recompiled the kernel with Intel ...
      (FreeBSD-Security)
    • mbuf error
      ... Mysql service is going down continously in my system due to lack of memory ... I checked the messages log and found the following error message. ... All mbuf clusters exhausted, please see tuning. ... 1545 requests for memory delayed ...
      (freebsd-questions)
    • Re: ASP .NET poor performance. Memory going unused??
      ... 1315 context switches per second is a lot, especially on Windows 2003 server ... objects, again, effectively serializing your requests. ... create a lot of data in the memory the memory usage should be fairly static. ...
      (microsoft.public.dotnet.framework.performance)
    • Mbuf errors
      ... Mysql service is going down continously in my system due to lack of memory ... I checked the messages log and found the following error message. ... All mbuf clusters exhausted, please see tuning. ... 1545 requests for memory delayed ...
      (FreeBSD-Security)
    • Re: Memory fragmentation issue in kernel mode
      ... My direct I/O requests are asynchronous ones with 4 parallel ... Memory usage of the applications were looking normal. ... fragmentation, which is actually fragmentation of the system virtual ... application which will be accessing my device to test the driver. ...
      (microsoft.public.development.device.drivers)