From owner-freebsd-performance@FreeBSD.ORG Fri Apr 16 16:17:58 2004 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 67AD416A4CE for ; Fri, 16 Apr 2004 16:17:58 -0700 (PDT) Received: from cmsrelay03.mx.net (cmsrelay03.mx.net [165.212.11.112]) by mx1.FreeBSD.org (Postfix) with SMTP id 13D7A43D49 for ; Fri, 16 Apr 2004 16:17:58 -0700 (PDT) (envelope-from noackjr@alumni.rice.edu) Received: from uadvg131.cms.usa.net (165.212.11.131) by cmsoutbound.mx.net with SMTP; 16 Apr 2004 23:17:57 -0000 Received: from optimator.noacks.org [66.139.21.136] by uadvg131.cms.usa.net (ASMTP/noackjr@usa.net) via mtad (C8.MAIN.3.13N) with ESMTP id 003iDPXR20313M31; Fri, 16 Apr 2004 23:17:53 GMT X-USANET-Auth: 66.139.21.136 AUTH noackjr@usa.net optimator.noacks.org Received: from localhost (localhost [127.0.0.1]) by optimator.noacks.org (Postfix) with ESMTP id 016E76163; Fri, 16 Apr 2004 18:17:51 -0500 (CDT) Received: from optimator.noacks.org ([127.0.0.1]) by localhost (optimator.noacks.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 83604-03; Fri, 16 Apr 2004 18:17:50 -0500 (CDT) Received: from alumni.rice.edu (optimator [192.168.1.11]) by optimator.noacks.org (Postfix) with ESMTP id 8E3F66165; Fri, 16 Apr 2004 18:17:50 -0500 (CDT) Message-ID: <4080699E.9060307@alumni.rice.edu> Date: Fri, 16 Apr 2004 18:17:50 -0500 From: Jon Noack User-Agent: Mozilla Thunderbird 0.5+ (Windows/20040312) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Aaron Seelye References: <20040416220556.GL87362@nasby.net> <002701c42404$e9dbecf0$3102a8c0@metallus> In-Reply-To: <002701c42404$e9dbecf0$3102a8c0@metallus> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at noacks.org cc: freebsd-performance@freebsd.org cc: "Jim C. Nasby" Subject: Re: command piped into bzip not using all available CPU X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: noackjr@alumni.rice.edu List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2004 23:17:58 -0000 On 4/16/2004 5:48 PM, Aaron Seelye wrote: > I would venture a guess that bzip is not multi threaded and therefore > isn't spreading the load around. I think you may be right. I tested this on my dual Pentium III 933 running 5.2.1-RELEASE-p5. bzip2 behaves like this while gzip behaves as expected. I know top sucks for measuring performance, but it should be accurate enough for the big picture. Here's the simple test with bzip2 (the rand() is to give perl "work"): perl -e 'do{print rand();}while 1' | bzip2 > /dev/null ********************************************************************** last pid: 83786; load averages: 0.53, 0.31, 0.19 up 4+03:06:50 17:54:52 92 processes: 2 running, 90 sleeping CPU states: 52.0% user, 0.0% nice, 11.1% system, 0.4% interrupt, 36.5% idle Mem: 222M Active, 154M Inact, 99M Wired, 22M Cache, 60M Buf, 2140K Free Swap: 1024M Total, 176K Used, 1024M Free PID USERNAME PRI NICE SIZE RES STATE C TIME WCPU CPU COMMAND 83784 noackjr 106 0 8804K 7280K CPU0 0 0:22 60.19% 49.76% bzip2 83783 noackjr -8 0 2756K 1908K pipdwt 0 0:14 38.87% 32.13% perl ********************************************************************** This time with gzip (with -9 to make gzip work harder): perl -e 'do{print rand();}while 1' | gzip -9 > /dev/null ********************************************************************** last pid: 83865; load averages: 1.11, 0.41, 0.28 up 4+03:18:11 18:06:13 91 processes: 4 running, 87 sleeping CPU states: 90.7% user, 0.0% nice, 1.6% system, 0.0% interrupt, 7.7% idle Mem: 215M Active, 155M Inact, 99M Wired, 19M Cache, 60M Buf, 10M Free Swap: 1024M Total, 176K Used, 1024M Free PID USERNAME PRI NICE SIZE RES STATE C TIME WCPU CPU COMMAND 83864 noackjr 117 0 2756K 1908K CPU0 0 0:32 88.37% 73.05% perl 83865 noackjr 116 0 1696K 960K RUN 0 0:30 84.65% 69.97% gzip ********************************************************************** On a moderately-related note, -CURRENT recently got some pipe updates (up to 75% bandwidth increase on i386): http://lists.freebsd.org/pipermail/cvs-src/2004-March/021197.html Jon Noack