From owner-freebsd-questions@FreeBSD.ORG Thu Nov 8 11:12:58 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8724816A417 for ; Thu, 8 Nov 2007 11:12:58 +0000 (UTC) (envelope-from bounces@nabble.com) Received: from kuber.nabble.com (kuber.nabble.com [216.139.236.158]) by mx1.freebsd.org (Postfix) with ESMTP id 46EAB13C4B6 for ; Thu, 8 Nov 2007 11:12:58 +0000 (UTC) (envelope-from bounces@nabble.com) Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Iq52N-0001RW-A0 for freebsd-questions@freebsd.org; Thu, 08 Nov 2007 02:55:03 -0800 Message-ID: <13644937.post@talk.nabble.com> Date: Thu, 8 Nov 2007 02:55:03 -0800 (PST) From: Atrox To: freebsd-questions@freebsd.org In-Reply-To: <44BCEF53.5060205@skoberne.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Nabble-From: silver.salonen@gmail.com References: <44BCEF53.5060205@skoberne.net> Subject: Re: No buffer space available error 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: Thu, 08 Nov 2007 11:12:58 -0000 Nejc =C5=A0koberne-2 wrote: >=20 > Hello, >=20 > I've been trying to solve this problem by myself for a long time now, but > no luck. > I run a few dozens of FreeBSD 5.3/5.4 machines, which serve as routers, > NAT boxes, > Apache, Postfix, OpenVPN, ... servers. Most of them are low-cost PC > machines since > they are usually deployed to SOHO environments and the loads are rather > low. >=20 > I am having problems with the "No buffer space available" error like this= : >=20 > Jul 18 08:49:36 Router openvpn[661]: write UDPv4: No buffer space > available (code=3D55) >=20 > so this is obviously when OpenVPN tries to send UDP packets. And also lik= e > this: >=20 > Jun 23 06:27:38 Router pdns[2182]: Unable to send a packet to our > recursing > backend: No buffer space available >=20 > when PowerDNS DNS server tries to do some recursive work. I have been > searching Google > for a solution and I found out that the error should appear when the mbuf > (or sfbuf?) > is "full" and that I can print the current buffer status with 'netstat > -m'. >=20 > Because the error would show up (and not only show up, but also block the > network > operability for that server) at random times, I set up the "swatch" daemo= n > on all those > servers, so that as soon as the error is logged in messages, I run this > command: >=20 > #!/usr/local/bin/bash > LOG=3D/var/log/swatch.log >=20 > datum=3D`date` > echo "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D $datum =3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D" > sockstat >> $LOG > echo "------------------------------------------------------------" >> > $LOG > netstat -n -a >> $LOG > echo "------------------------------------------------------------" >> > $LOG > netstat -m >> $LOG > echo "------------------------------------------------------------" >> > $LOG > ps ax >> $LOG > echo "=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=3D=3D=3D=3D=3D=3D=3D=3D" >> > $LOG >=20 > Even though the log was growing as I assumed, I couldn't find anything > particulary > interesting, because the "netstat -m" command issued by swatch (at the > time of the > error) still shows something like this: >=20 > 2 mbufs in use > 1/17088 mbuf clusters in use (current/max) > 0/6/4528 sfbufs in use (current/peak/max) > 2 KBytes allocated to network > 0 requests for sfbufs denied > 0 requests for sfbufs delayed > 1819 requests for I/O initiated by sendfile > 7578 calls to protocol drain routines >=20 > I am not sure, but as I understand it, this means that the buffers are > quite OK. >=20 > What would be the "proper" way to debug this problem? This is happening o= n > machines > with various hardware, from good old Pentium I with 32 MB RAM up to P4 > 3GHz, 1GB RAM, > various network cards (mostly rtl8139), with ADSL or VDSL, although the > errors are > very rare at the VDSL boxes (where the upstream bandwidth is substantiall= y > greater). >=20 > So, usually the errors appear but the users don't bother really, so it > looks like > the problems goes away sometimes (the connection is restored), but > sometimes reboot > is needed. >=20 > Thanks for your ideas. >=20 > P.S.: If the output of the script above could be helpful, let me know, I > can publish > it somewhere. >=20 > Cheers, > Nejc >=20 Hello Nejc! Have you managed to solve this? I've just been having the same issue - I've set up multiple OpenVPN connections with TAP-device (FreeBSD-5.3 as server, 5.4 as client, multiple 4.x as clients etc.) and the server gives the same error regularly - I can't restart the server, the error occures every 30 minutes or so.. Do you know what's the deal with these buffers? My netstat -m shows: 520 mbufs in use 515/128000 mbuf clusters in use (current/max) 0/5/6656 sfbufs in use (current/peak/max) 1160 KBytes allocated to network 0 requests for sfbufs denied 0 requests for sfbufs delayed 0 requests for I/O initiated by sendfile 9814 calls to protocol drain routines --=20 View this message in context: http://www.nabble.com/No-buffer-space-availab= le-error-tf1960830.html#a13644937 Sent from the freebsd-questions mailing list archive at Nabble.com.