From owner-freebsd-net@FreeBSD.ORG Mon Jan 19 02:33:56 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2156B16A4CE; Mon, 19 Jan 2004 02:33:56 -0800 (PST) Received: from relay.macomnet.ru (relay.macomnet.ru [195.128.64.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 73A1E43D4C; Mon, 19 Jan 2004 02:33:53 -0800 (PST) (envelope-from maxim@macomnet.ru) Received: from news1.macomnet.ru (gog401zp@news1.macomnet.ru [195.128.64.14]) by relay.macomnet.ru (8.12.10/8.12.10) with ESMTP id i0JAWGhg3588493; Mon, 19 Jan 2004 13:32:16 +0300 (MSK) Date: Mon, 19 Jan 2004 13:32:16 +0300 (MSK) From: Maxim Konovalov To: CHOI Junho In-Reply-To: <20040119.192257.34695172.cjh@kr.FreeBSD.org> Message-ID: <20040119132741.O42397@news1.macomnet.ru> References: <20040119.153452.10362034.cjh@kr.FreeBSD.org> <20040119.192257.34695172.cjh@kr.FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-net@freebsd.org cc: freebsd-performance@freebsd.org Subject: Re: mbuf tuning X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2004 10:33:56 -0000 On Mon, 19 Jan 2004, 19:22+0900, CHOI Junho wrote: > From: Mike Silbersack > Subject: Re: mbuf tuning > Date: Mon, 19 Jan 2004 01:12:08 -0600 (CST) > > > There are no good guidelines other than "don't set it too high." Andre > > and I have talked about some ideas on how to make mbuf usage more dynamic, > > I think that he has something in the works. But at present, once you hit > > the wall, that's it. > > > > One way to reduce mbuf cluster usage is to use sendfile where possible. > > Data sent via sendfile does not use mbuf clusters, and is more memory > > efficient. If you run 5.2 or above, it's *much* more memory efficient, > > due to change Alan Cox recently made. Apache 2 will use sendfile by > > default, so if you're running apache 1, that may be one reason for an > > upgrade. > > I am using custom version of thttpd. It allocates mmap() first(builtin > method of thttpd), and it try to use sendfile() if mmap() fails(out of > mmap memory). It really works good in normal status but the problem is > that sendfile buffer is also easy to flood. I need more sendfile > buffers but I don't know how to increase sendfile buffers either(I > think it's hidden sysctl but it was more difficult to tune than > nmbclusters). With higher traffic, thttpd sometimes stuck at "sfbufa" > status when I run top(I guess it's "sendfile buffer allocation" > status). man 2 sendfile, man 7 tuning are a good start. In 5.2 you can monitor sendfile buffers usage via kern.ipc.nsfbufs* sysctls or netstat(1). [...] -- Maxim Konovalov, maxim@macomnet.ru, maxim@FreeBSD.org