From owner-freebsd-stable@FreeBSD.ORG Tue Nov 16 13:30:55 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2D8A106566B for ; Tue, 16 Nov 2010 13:30:55 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 82DE28FC08 for ; Tue, 16 Nov 2010 13:30:55 +0000 (UTC) Received: by vws4 with SMTP id 4so158082vws.13 for ; Tue, 16 Nov 2010 05:30:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=eiCTNPuNRX1r8AepAbI59qS53tD891KvRemRrna/W4I=; b=GTeL90XNTD9UBUupJm8Jh+da22pJF7PWJeKuuLgD6v5aDlw8yxKpiXNMmVBOUazNiR 8ZKZZ37o3nX/cHLEzhOTM3UwHYRz/6+Jg65m33T/cp0UjCHRmJuXGcKqrZfZcYZDjyah Cg3d4aplhJyqZI4N0onDFdbCz46kxebCowQbQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=kBiduYjYodSR5NP446tgB4KbXr/4A1HrC1p8cxVSv8s9BjramWSlt2OV0kZgGsDqIY thJZgFRzhgDF9CWk26Q79p9hnR0bq9THmf2aPJ2p5t0nq9ZEnRKEfgWstPEiAAXTHp4t dXXW2tY3IjyyBd1mUFrbRr2WaFIEu5Q/teQFU= Received: by 10.229.82.70 with SMTP id a6mr6386487qcl.9.1289912389789; Tue, 16 Nov 2010 04:59:49 -0800 (PST) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.229.231.143 with HTTP; Tue, 16 Nov 2010 04:59:09 -0800 (PST) In-Reply-To: References: <20101116003029.GC79816@numachi.com> From: Ivan Voras Date: Tue, 16 Nov 2010 13:59:09 +0100 X-Google-Sender-Auth: LapzDGBNHgsJo1CosEWnGYtuT_8 Message-ID: To: Christer Solskogen Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-stable@freebsd.org Subject: Re: "High" cpu usage when using ZFS cache device X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2010 13:30:55 -0000 On 16 November 2010 13:15, Christer Solskogen wrote: > On Tue, Nov 16, 2010 at 12:47 PM, Ivan Voras wrote: > >> You can easily test it - use the stick as a simple disk device with UFS = and >> see how much CPU does it take simply to talk to the device. > > See, that is why I think it is a ZFS issue. Because I did that. > I created a UFS filesystem on the same usb stick. Mounted it and did a > "dd if=3D/dev/zero of=3D/mnt/file". > The systemload goes +0.6 instead if +10.3. > > See: > CPU: =C2=A00.0% user, =C2=A00.0% nice, =C2=A00.6% system, =C2=A00.0% inte= rrupt, 99.3% idle > Mem: 832M Active, 960M Inact, 7017M Wired, 2600K Cache, 1237M Buf, 3063M = Free > Swap: 8192M Total, 8192M Free > > =C2=A0PID USERNAME =C2=A0 =C2=A0THR PRI NICE =C2=A0 SIZE =C2=A0 =C2=A0RES= STATE =C2=A0 C =C2=A0 TIME =C2=A0 WCPU COMMAND > 38261 root =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A01 =C2=A046 =C2=A0 =C2=A00 = =C2=A05776K =C2=A01112K wdrain =C2=A07 =C2=A0 0:07 =C2=A04.98% dd > > But when using it as cache device for zfs: > > CPU: =C2=A00.0% user, =C2=A00.0% nice, 11.9% system, =C2=A00.0% interrupt= , 88.1% idle > Mem: 832M Active, 193M Inact, 5782M Wired, 2592K Cache, 1237M Buf, 5066M = Free > Swap: 8192M Total, 8192M Free > > The funny thing is that when I add the device (and some cache is added > to it) the load is normal. But the load goes up when nothing is > written to it (or beeing read from it) You mean you have system load on an otherwise idle system? Try this: 1) start "top" with parameters -H -S, see if anything is using the CPU time 2) start "gstat", see if anything is using IO, and if it's particularly slow or busying the device too much