From owner-freebsd-questions@FreeBSD.ORG Thu Jul 8 17:28:11 2010 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 690FB1065673 for ; Thu, 8 Jul 2010 17:28:11 +0000 (UTC) (envelope-from glarkin@FreeBSD.org) Received: from mail1.sourcehosting.net (113901-app1.sourcehosting.net [72.32.213.11]) by mx1.freebsd.org (Postfix) with ESMTP id 451FF8FC14 for ; Thu, 8 Jul 2010 17:28:10 +0000 (UTC) Received: from 68-189-245-235.dhcp.oxfr.ma.charter.com ([68.189.245.235] helo=cube.entropy.prv) by mail1.sourcehosting.net with esmtp (Exim 4.69 (FreeBSD)) (envelope-from ) id 1OWutI-000Peu-5k; Thu, 08 Jul 2010 13:28:09 -0400 Received: from [127.0.0.1] (fireball.entropy.prv [192.168.1.12]) by cube.entropy.prv (Postfix) with ESMTP id 6A57C4245218; Thu, 8 Jul 2010 13:28:04 -0400 (EDT) Message-ID: <4C360AA0.1060709@FreeBSD.org> Date: Thu, 08 Jul 2010 13:28:00 -0400 From: Greg Larkin Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: David Kelly References: <1278604252.12047.13.camel@localhost> <20100708164437.GA21881@slackbox.erewhon.net> <20100708170458.GA34226@Grumpy.DynDNS.org> In-Reply-To: <20100708170458.GA34226@Grumpy.DynDNS.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=1C940290 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -0.3 (/) Cc: Roland Smith , Jozsi Avadkan , FreeBSD Mailing list Subject: Re: slow down dd - how? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: glarkin@FreeBSD.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 17:28:11 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 David Kelly wrote: > On Thu, Jul 08, 2010 at 06:44:38PM +0200, Roland Smith wrote: >> On Thu, Jul 08, 2010 at 05:50:52PM +0200, Jozsi Avadkan wrote: >>> How can I slow down dd? >> Play with the block size parameter (bs). Smaller block sizes means more >> reads. The default is 512 bytes, which is very small. >> >>> I don't want to slow down the pc, when generating a big file [~40 >>> GByte]. > > I don't think Jozsi wants to burn more CPU cycles, just slow the > process. Perhaps to attract less attention? Or interfere less with other > processes. > > Nice(1) is a good start but rtprio(1) is probably where he should look. > > Also consider that writing a program of your own to serve as a slow pipe > shouldn't be very hard. Think it would be a good exercise as an > introduction to Unix programming. Simply copy stdin to stdout with a > usleep(3) between. Pipe dd through your slowpipe program. > > Someone else has probably written a slow pipe. I haven't looked. > Indeed someone has, and I ported it a few months back: http://www.freshports.org/sysutils/pmt. Check the "throttle" subcommand. I also use idprio(1) (http://www.freebsd.org/cgi/man.cgi?query=idprio&sourceid=opensearch) to schedule processes that I don't want interfering with the rest of the system. Hope that helps, Greg - -- Greg Larkin http://www.FreeBSD.org/ - The Power To Serve http://www.sourcehosting.net/ - Ready. Set. Code. http://twitter.com/sourcehosting/ - Follow me, follow you -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFMNgqg0sRouByUApARAmsbAJ9ayMlkCUhJpJr0HsPxMmHQ1ToYzgCgrJGX uIeciRHWwaNYrchL4TjYnkA= =NKtY -----END PGP SIGNATURE-----