From owner-freebsd-stable@FreeBSD.ORG Tue Nov 16 12:56:22 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 108BF106566C for ; Tue, 16 Nov 2010 12:56:22 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 7ED8F8FC14 for ; Tue, 16 Nov 2010 12:56:21 +0000 (UTC) Received: from outgoing.leidinger.net (p57B3A17E.dip.t-dialin.net [87.179.161.126]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 44A5784400E; Tue, 16 Nov 2010 13:56:17 +0100 (CET) Received: from webmail.leidinger.net (unknown [IPv6:fd73:10c7:2053:1::2:102]) by outgoing.leidinger.net (Postfix) with ESMTP id C2E0129EC; Tue, 16 Nov 2010 13:56:12 +0100 (CET) Received: (from www@localhost) by webmail.leidinger.net (8.14.4/8.13.8/Submit) id oAGCtvmg077790; Tue, 16 Nov 2010 13:55:57 +0100 (CET) (envelope-from Alexander@Leidinger.net) Received: from pslux.ec.europa.eu (pslux.ec.europa.eu [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Tue, 16 Nov 2010 13:55:57 +0100 Message-ID: <20101116135557.66601irt6kd1gndw@webmail.leidinger.net> Date: Tue, 16 Nov 2010 13:55:57 +0100 From: Alexander Leidinger To: Christer Solskogen References: <20101116003029.GC79816@numachi.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4) X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 44A5784400E.A6258 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=1.274, required 6, autolearn=disabled, RDNS_NONE 1.27) X-EBL-MailScanner-SpamScore: s X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1290516978.69831@Vk9LXFLsopjlYmkTlDf8eA X-EBL-Spam-Status: No Cc: freebsd-stable@freebsd.org, Ivan Voras 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 12:56:22 -0000 Quoting Christer Solskogen (from Tue, 16 Nov 2010 13:15:32 +0100): > 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=/dev/zero of=/mnt/file". > The systemload goes +0.6 instead if +10.3. > > See: > CPU: 0.0% user, 0.0% nice, 0.6% system, 0.0% interrupt, 99.3% idle > Mem: 832M Active, 960M Inact, 7017M Wired, 2600K Cache, 1237M Buf, 3063M Free > Swap: 8192M Total, 8192M Free > > PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND > 38261 root 1 46 0 5776K 1112K wdrain 7 0:07 4.98% dd > > But when using it as cache device for zfs: > > CPU: 0.0% user, 0.0% nice, 11.9% system, 0.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) How do you measure that nothing is read or written to it? Please check with gstat -f '^$' if there are really no reads/writes to the device (please replace with the name of your USB device, e.g. da0). If you see writes, I would say - this is the reason for the load - your cache is on the way to be filled with useful data If gstat shows zero activity, I suggest to run 'top -S' and look at the process(es) which consume about 10% CPU (do not take care about the idle process). Based upon this we can maybe suggest further things to investigate. Bye, Alexander. -- Is a tattoo real, like a curb or a battleship? Or are we suffering in Safeway? http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137