From owner-freebsd-net@FreeBSD.ORG Wed Aug 27 08:43:29 2003 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 E99BD16A4BF for ; Wed, 27 Aug 2003 08:43:28 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2266943FD7 for ; Wed, 27 Aug 2003 08:43:28 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.9/8.12.9) with ESMTP id h7RFh4rO025603; Wed, 27 Aug 2003 11:43:04 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)h7RFh4Ze025600; Wed, 27 Aug 2003 11:43:04 -0400 (EDT) Date: Wed, 27 Aug 2003 11:43:03 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: "Giovanni P. Tirloni" In-Reply-To: <20030827030314.GJ40033@pixies.tirloni.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-net@freebsd.org Subject: Re: mbuf usage for an idle machine 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: Wed, 27 Aug 2003 15:43:29 -0000 On Wed, 27 Aug 2003, Giovanni P. Tirloni wrote: > I've been reading about mbufs and how they're used for > holding network packets and socket buffers and the > output of 'netstat -m' for a idle machine I've here > made me curious about how FreeBSD handles it in -CURRENT. > > Why is it using so many mbufs when it's idle? My > small kwnowledge doesn't permit me to answer this > question yet ;) There are a number of situations in which the mbuf allocator is used to allocate non-mbufs -- for example, we use mbufs to hold IP fragment queues, as well as some static packet prototype mbufs, socket options, etc. I'd like to eliminate at least a few of these by replacing the use with the existing kernel allocator, which would reduce the "spurious" mbuf use. The other typical source of mbufs that are never free'd are mbuf leaks, but the allocations you have right now look low enough that it's not that, I suspect. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories > > root@gate:~# netstat -m > mbuf usage: > GEN cache: 0/0 (in use/in pool) > CPU #0 cache: 130/288 (in use/in pool) > Total: 130/288 (in use/in pool) > Mbuf cache high watermark: 512 > Maximum possible: 9856 > Allocated mbuf types: > 130 mbufs allocated to data > 2% of mbuf map consumed > mbuf cluster usage: > GEN cache: 0/8 (in use/in pool) > CPU #0 cache: 128/256 (in use/in pool) > Total: 128/264 (in use/in pool) > Cluster cache high watermark: 128 > Maximum possible: 4928 > 5% of cluster map consumed > 600 KBytes of wired memory reserved (48% in use) > 0 requests for memory denied > 0 requests for memory delayed > 0 calls to protocol drain routines > > root@gate:~# sockstat -4c > USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS > bs2 sshd 2085 4 tcp4 192.168.200.1:22 200.200.200.200:1405 > root sshd 2082 4 tcp4 192.168.200.1:22 200.200.200.200:1405 > > root@gate:~# sockstat -4l > USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS > root mpd 635 14 tcp4 192.168.200.1:1723 *:* > nobody squid 614 4 udp4 *:49184 *:* > nobody squid 614 20 tcp4 127.0.0.1:3128 *:* > root dhcpd 469 6 udp4 *:67 *:* > root sendmail 432 3 tcp4 127.0.0.1:25 *:* > root sshd 426 3 tcp4 *:22 *:* > root ntpd 407 4 udp4 *:123 *:* > root ntpd 407 5 udp4 192.168.0.254:123 *:* > root ntpd 407 6 udp4 192.168.200.1:123 *:* > root ntpd 407 7 udp4 127.0.0.1:123 *:* > bind named 292 4 udp4 *:49152 *:* > bind named 292 20 udp4 192.168.0.254:53 *:* > bind named 292 21 tcp4 192.168.0.254:53 *:* > bind named 292 22 udp4 127.0.0.1:53 *:* > bind named 292 23 tcp4 127.0.0.1:53 *:* > > FreeBSD gate 5.1-CURRENT FreeBSD 5.1-CURRENT #4: Wed Jul 23 \ > 11:22:55 BRT 2003 root@gate:/usr/src/sys/i386/compile/ \ > GATE i386 > > It has 2 ethernet interfaces (192.168.200.1 and 192.168.0.254) > > I'll be happy to provide any additional information if it's > needed. > > -- > Giovanni P. Tirloni > http://www.tirloni.org > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >