From owner-freebsd-questions@FreeBSD.ORG Fri Dec 8 19:33:32 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CC4E016A407 for ; Fri, 8 Dec 2006 19:33:32 +0000 (UTC) (envelope-from kris@obsecurity.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0A50443CA5 for ; Fri, 8 Dec 2006 19:32:33 +0000 (GMT) (envelope-from kris@obsecurity.org) Received: from obsecurity.dyndns.org (elvis.mu.org [192.203.228.196]) by elvis.mu.org (Postfix) with ESMTP id 4F4451A3C19; Fri, 8 Dec 2006 11:33:32 -0800 (PST) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id 2F1BB513F8; Fri, 8 Dec 2006 14:33:31 -0500 (EST) Date: Fri, 8 Dec 2006 14:33:30 -0500 From: Kris Kennaway To: Dieter Message-ID: <20061208193330.GA69614@xor.obsecurity.org> References: <20061208000932.GA35387@xor.obsecurity.org> <200612080141.BAA07359@sopwith.solgatos.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PNTmBPCT7hxwcZjr" Content-Disposition: inline In-Reply-To: <200612080141.BAA07359@sopwith.solgatos.com> User-Agent: Mutt/1.4.2.2i Cc: freebsd-questions@freebsd.org, Kris Kennaway Subject: Re: processes not getting fair share of available disk I/O (was: Re: TCP parameters and interpreting tcpdump output ) 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, 08 Dec 2006 19:33:32 -0000 --PNTmBPCT7hxwcZjr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 07, 2006 at 05:41:51PM +0000, Dieter wrote: > > However, I don't know what you mean by "data is lost". Data should > > never be lost from the filesystem regardless of how slow the I/O is > > happening, unless there's something else going wrong (e.g. driver > > bug). > >=20 > > Also, rtprio should not be used in general - see the manpage. Were > > you using rtprio in your original scenario? It can easily cause > > resource starvation. >=20 > I have data arriving on Ethernet. The data rate is 2.5 MB/s max, > but the other end only has a small buffer. If the BSD box doesn't read > the port fast enough, the data is lost. I have a C program (port2file) > reading from the port into a *large* circular buffer, currently 431,226,8= 80 > bytes. This should be enough to buffer over 2 minutes of data. It does > non-blocking 64KB writes to stdout. Shell script calls this program and > redirects stdout to a disk file. Very little if any other i/o to this > disk. Even with disk cache in write-through mode, I can write at about > 6-7 MB/s. The process needs very little CPU. Sounds like this should > be no problem. >=20 > And it seems to work okay if the system is otherwise idle. >=20 > The problem is that if some other process is writing to some other disk, > it somehow slows down writes to ALL disks. Enough that, dispite the non-= blocking > writes (?), the TCP receive window shrinks and shrinks and finally is sma= ller > than a packet. The src machine obediantly stops sending packets, its sma= ll > buffer fills up, and data is lost. >=20 > Things I have done so far: >=20 > BIG buffer (over 2 minutes worth). >=20 > The port2file process cranks up the TCP receive window from 65700 to 1= 97100. >=20 > It also cranks up rtprio from 20 to 5. >=20 > sysctl net.inet.tcp.delayed_ack=3D0 >=20 > The only process running rtprio is port2file. All other processes are > either default priority or niced down with the classic nice(1). Thanks for explaining the problem in more detail. Did this problem start before you made port2file run with rtprio? Can you please include a copy of your kernel configuration file and dmesg? Kris --PNTmBPCT7hxwcZjr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFFeb4KWry0BWjoQKURAqwCAJ0alPuCL2YATCMXXOclbVlza1wEHgCfe5bB MYgkuKF/40EmL7Iv2KmjDbU= =4WhP -----END PGP SIGNATURE----- --PNTmBPCT7hxwcZjr--