From owner-freebsd-hackers Thu Sep 9 23:42:31 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from sonet.crimea.ua (OTC-sl3-FLY.CRIS.NET [212.110.136.71]) by hub.freebsd.org (Postfix) with ESMTP id 9EB43151DF; Thu, 9 Sep 1999 23:41:47 -0700 (PDT) (envelope-from stas@sonet.crimea.ua) Received: (from stas@localhost) by sonet.crimea.ua (8.8.8/8.8.8) id JAA13107; Fri, 10 Sep 1999 09:41:54 +0400 (MSD) (envelope-from stas) Date: Fri, 10 Sep 1999 09:41:54 +0400 (MSD) From: Stas Kisel Message-Id: <199909100541.JAA13107@sonet.crimea.ua> To: jared@puck.nether.net, stas@sonet.crimea.ua Subject: Re: mbuf shortage situations Cc: avalon@coombs.anu.edu.au, freebsd-hackers@FreeBSD.ORG, freebsd-security@FreeBSD.ORG In-Reply-To: <19990909110720.A6694@puck.nether.net> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > From jared@puck.nether.net Thu Sep 9 18:10:06 1999 > I am creating about 100 icmp sockets, and as they are > created, allocate a very large SO_RCVBUF: > (void)setsockopt(localstruct->icmp_s, SOL_SOCKET, > SO_RCVBUF, (char *)&hold, sizeof(hold)); This can be a part of the problem too. setsockopt() have to check if there is really free memory for buffer and set an appropriate, described in man page errno if failed. In my test, 2.2.7 kernel allowed me to "allocate" in this way 15M "for buffers" on a 32M machine (NMBCLUSTERS=1024, maxusers=50). Probably it could allow more, but I thought 15M is too much anyways. There is a limitation - buffer can not be bigger than ~240k. I did not checked which errno setsockopt() returns, but I didn't found anything appropriate in a man page. -- Stas Kisel. UNIX, security, C, TCP/IP, Web. UNIX - the best adventure game http://www.tekmetrics.com/transcript.shtml?pid=20053 http://www.crimea.edu +380(652)510222,230238 ; stas@crimea.edu stas@sonet.crimea.ua ; 2:460/54.4 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message