From owner-freebsd-questions Wed Jun 20 14:35:33 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mail.communityconnect.com (mail.communityconnect.com [209.10.169.57]) by hub.freebsd.org (Postfix) with ESMTP id 3342C37B407 for ; Wed, 20 Jun 2001 14:35:26 -0700 (PDT) (envelope-from marius@mail.communityconnect.com) Received: from amavis by mail.communityconnect.com with scanned-ok (Exim 3.20 #1) id 15CpdF-0004Nl-00 for questions@freebsd.org; Wed, 20 Jun 2001 17:35:25 -0400 Received: from [206.28.215.90] (helo=utterlux.hq.communitconnect.com) by mail.communityconnect.com with esmtp (Exim 3.20 #1) id 15CpdA-0004HU-00; Wed, 20 Jun 2001 17:35:20 -0400 Date: Wed, 20 Jun 2001 17:35:24 -0400 (EDT) From: Marius X-Sender: marius@utterlux.hq.communitconnect.com To: Mikko Tyolajarvi Cc: stable@FreeBSD.org, questions@FreeBSD.org Subject: Re: running out of buffer space for sockets In-Reply-To: <200106192008.f5JK8aY55684@explorer.rsa.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN Content-Transfer-Encoding: QUOTED-PRINTABLE Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Ah, Thank you that cleared up a lot of issues. I have a greater idea of what I am dealing with at least. It is interesting that on the 4.x machine my fstat output is about 10x what my output for sockstat is. This is not the case on my 3.x machines. I am not _exactly_ sure what that means, but now at least I have a way of looking into the problem. Thank you again. -Marius M. Rex On Tue, 19 Jun 2001, Mikko Tyolajarvi wrote: > Yo! >=20 > In local.freebsd.stable you write: >=20 > >*smile* >=20 > >=09Given my sometimes hideous abuse of the English language, it does > >not surprise me that someone would think I made a typo. Actually, I mea= nt > >what I said. I am using thttpd not httpd. It is a single instance, > >spawning no children. > >=09You have a point though, I will indeed scan the docs to see if > >there is anything on thttpd's side that can be done to quell the tide. = =20 > >=09The pecular part about this is that my 3.5-Stable servers don't have > >such problems. With the same augents to the kernel (maxusers at 128 =20 > >and NMBCLUSTERS at 16384) my 4.2-Stable box had significantly fewer > >kernel resources then my 3.5-Stable boxen. It would freeze up and die > >(couldn't open more filehandles) after about a day of serving. I manual= ly >=20 > You could be hitting the "maxsockets" limit (16k in your case). >=20 > Dunno if this will help, but here is what I would do: >=20 > - Check that thttpd isn't leaking sockets (fds). fstat -p PID | wc -l > Correlate with "sockstat | wc -l". Try to figure out if all your > sockets are in use (I don't think you will see pending connections > with either of these commands, though). >=20 > - If you conclude thttpd is leaking sockets, fix it :-) >=20 > - Otherwise, it looks like "maxsockets" is a kernel tunable, so > echo kern.ipc.maxsockets=3D'"65536"' >> /boot/loader.conf > and reboot. If the values below are correct, you are nowhere near > exhausting your mbufs. >=20 > Also see comment in /sys/kern/uipc_domain.c:domaininit() >=20 > $.02, > /Mikko >=20 > [...] >=20 > >>kern.ipc.maxsockets: 16384=09<- Lower than your 64k maxfiles >=20 > [...] >=20 > >># netstat -m > >>7115/8624/65536 mbufs in use (current/peak/max): > >> 5454 mbufs allocated to data > >> 1661 mbufs allocated to packet headers > >>5056/5854/16384 mbuf clusters in use (current/peak/max) > >>13864 Kbytes allocated to network (28% of mb_map in use) >=20 > Only about one third of buffers in use. > --=20 > Mikko Ty=F6l=E4j=E4rvi_______________________________________mikko@rsase= curity.com > RSA Security >=20 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message