From owner-freebsd-questions@FreeBSD.ORG Fri Feb 24 17:02:17 2006 Return-Path: X-Original-To: questions@freebsd.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1A82F16A423 for ; Fri, 24 Feb 2006 17:02:17 +0000 (GMT) (envelope-from infofarmer@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.192]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9A26F43D46 for ; Fri, 24 Feb 2006 17:02:16 +0000 (GMT) (envelope-from infofarmer@gmail.com) Received: by zproxy.gmail.com with SMTP id 13so362507nzp for ; Fri, 24 Feb 2006 09:02:16 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ueMQFa5krU1Qfcdl+4Q+q1JnWRu7uaPtUPWQnxuXBBKk/CcioF1fTUa2wuQJI3o15FMChmMeTanG2CQO7KF6Y6fQGS4xY0cfcH1g+026aJ5hHGfM9ar5ZNFGQVeFANlPflf/zMsp1ygjonoOG6F1CasWKg+SI8hnrSDPDwO6omI= Received: by 10.37.15.25 with SMTP id s25mr2278763nzi; Fri, 24 Feb 2006 09:02:15 -0800 (PST) Received: by 10.37.20.11 with HTTP; Fri, 24 Feb 2006 09:02:15 -0800 (PST) Message-ID: Date: Fri, 24 Feb 2006 20:02:15 +0300 From: "Andrew Pantyukhin" To: "Chuck Swiger" In-Reply-To: <43E62B9D.5040302@mac.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <43E62B9D.5040302@mac.com> Cc: FreeBSD Questions Subject: Re: Trouble with resources under network load X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Feb 2006 17:02:17 -0000 On 2/5/06, Chuck Swiger wrote: > Andrew Pantyukhin wrote: > > I'm constantly stumbling upon some out-of-resources > > problems. Just to name a couple: > > > > named[400]: client 10.32.23.92#1714: > > error sending response: not enough free resources > > > > snmpd[806]: sysctl get: Cannot allocate memory > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > > > I have these in loader.conf and sysctl.conf: > > > > kern.maxfiles=3D65536 > > kern.maxfilesperproc=3D65536 > > net.graph.maxdgram=3D65536 > > net.graph.recvspace=3D65536 > > kern.maxusers=3D512 > > kern.ipc.maxpipekva=3D268435456 > > net.graph.maxalloc=3D65536 > [ ... ] > > What's wrong? > > For one thing, if you've got a machine with 256MB of RAM, you cannot poss= ibly be > able to dedicate 256MB just to kern.ipc.maxpipekva. Likewise, a machine = with > 256MB of users would auto-tune kern.maxusers to ~100 or so, and kern.maxf= iles > ought to be under 10000, if not half that. > > You should revert to the defaults and make gradual tuning changes, if nee= ded, > from there. A couple of days ago I've added 512MB RAM, bringing the total up to 768MB. I followed your advice and eased the sysctl settings: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D kern.maxfiles=3D7500 kern.maxfilesperproc=3D7000 net.graph.maxdgram=3D65536 net.graph.recvspace=3D65536 net.inet.tcp.blackhole=3D2 net.inet.udp.blackhole=3D1 net.link.ether.inet.maxtries=3D2 net.link.ether.inet.max_age=3D7200 net.link.ether.inet.prune_intvl=3D1200 net.inet.tcp.minmssoverload=3D50 net.inet.tcp.msl=3D7500 net.inet.icmp.icmplim=3D50 kern.ipc.somaxconn=3D16384 kern.ipc.maxpipekva=3D50331648 net.graph.maxalloc=3D65536 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D gw# netstat -m 872/4123/4995 mbufs in use (current/cache/total) 870/3872/4742/24768 mbuf clusters in use (current/cache/total/max) 0/5/6448 sfbufs in use (current/peak/max) 1982K/8774K/10757K bytes allocated to network (current/cache/total) 0 requests for sfbufs denied 0 requests for sfbufs delayed 0 requests for I/O initiated by sendfile 0 calls to protocol drain routines =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D gw# netstat -s | grep drop 2776 connections closed (including 435 drops) 11 embryonic connections dropped 198 connections dropped by rexmit timeout 0 connections dropped by persist timeout 9 connections dropped by keepalive 1 dropped 53405 dropped due to no socket 460821 broadcast/multicast datagrams dropped due to no socket 0 dropped due to full socket buffers 0 fragments dropped (dup or out of space) 685 fragments dropped after timeout 193 output packets dropped due to no bufs, etc. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Feb 24 19:47:21 gw named[482]: client 10.32.7.32#1027: error sending response: not enough free resources =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Feb 24 19:46:57 gw snmpd[714]: sysctl get: Cannot allocate memory Feb 24 19:56:00 gw last message repeated 50 times =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D last pid: 86717; load averages: 0.00, 0.00, 0.00 up 3+02:57:27 19:59:39 29 processes: 1 running, 28 sleeping CPU states: 0.4% user, 0.0% nice, 0.0% system, 1.5% interrupt, 98.1% id= le Mem: 39M Active, 311M Inact, 132M Wired, 20K Cache, 84M Buf, 246M Free Swap: 453M Total, 453M Free PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND 714 root 1 96 0 3036K 2744K select 14:22 2.78% bsnmpd 17259 root 1 96 0 7268K 5664K select 7:54 0.00% mpd 287 root 1 96 0 3044K 2584K select 4:31 0.00% natd 482 bind 1 96 0 20224K 19280K select 2:36 0.00% named 55185 root 1 96 0 3772K 2456K select 0:36 0.00% nmbd 473 root 1 96 0 1352K 880K select 0:24 0.00% syslogd 574 root 1 96 0 3052K 1764K select 0:08 0.00% ntpd 636 dhcpd 1 96 0 3028K 2656K select 0:06 0.00% dhcpd =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Is there a change to trace the problem to its source?