From owner-freebsd-current@freebsd.org Thu Sep 6 00:28:31 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2A88FCEEE3 for ; Thu, 6 Sep 2018 00:28:30 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47BBE7B6BF; Thu, 6 Sep 2018 00:28:30 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pf1-x443.google.com with SMTP id k19-v6so4332342pfi.1; Wed, 05 Sep 2018 17:28:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ZDZ/2qwDu3VgVQl0rA/CbcIXxHJZvYHHnKF4e3UZrXg=; b=piY25T/vFvQyYGmRolxamIZ58ehR5FDBZtd8ebfFWgB32vhUCrXKPFtNLprqZVF7Bb FhtcOBwq4jT6sDZDwqsifzndZ32BLGZO8HoJIwsITbK1uMZ/AaLMazSo9rbevPmfHNPx di0vl90FxexFEM0gzKAeYuQKKQLOjce/lfjfISooO6g+oq05n1jncG5Bwg7lF9haCyw6 w0J48HwHqHQ6LAOnG2LSBRhkQV/5Q9L7Nak310Yk4tPjvTfEhrURdMueUP2gmhbV/ngD B5Dp2aN7Q6x15UlyjObcxa9UV/3I2EgvceoEahjTCI9PLPFAh9fnkOswf4vpkTIsbuCu dHAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=ZDZ/2qwDu3VgVQl0rA/CbcIXxHJZvYHHnKF4e3UZrXg=; b=asoocK8Ls/jQSJ18/8HcOYhJuXhRbZMvs3kwFy1X1SfmSZzPPFjRRJaTxap+6q2b7J QYyyEfeLUTLEeXmgvSMd5tu9A5qThl9MTQbY96oGLfwRJ6asK5avlRKrSZ6jrTzlmxnZ 4lHFTE1/cdGTxz85J+dILBFyKEfGStbpEtTQcpEinKlGsxJ8ggtBcqn/PNn8dwOXfqkZ GaDWfJZsUW1kS61jiKaq/Tl7QgIrRpz+BG1q6snNJ+WG9wBFT7DkNYOZu6QBBA90DI8C DQKtD4H6wtmvu9kRGHgjcHInI0i0xljyZetIlzKX0TcHmzmjh+YvuwifgB32iGh8l6JG /HxA== X-Gm-Message-State: APzg51AiTZsOZZe/TPnFNNJwGR8kTIDwKOl9QVx/1bVYzuI96phw2496 5BXXmIwlcJeHBue4VIzE3zK2AMKx X-Google-Smtp-Source: ANB0VdbHBhANBrNQrvJRl+9RKuCuvJF81ojSahtzmOE3yVDJhloEvCtSBK4WFLc9qQyzj1nayh6Lhg== X-Received: by 2002:a63:1316:: with SMTP id i22-v6mr267094pgl.86.1536193709330; Wed, 05 Sep 2018 17:28:29 -0700 (PDT) Received: from raichu (toroon0560w-lp130-09-70-52-224-239.dsl.bell.ca. [70.52.224.239]) by smtp.gmail.com with ESMTPSA id h4-v6sm6170622pfe.49.2018.09.05.17.28.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 17:28:28 -0700 (PDT) Sender: Mark Johnston Date: Wed, 5 Sep 2018 20:28:25 -0400 From: Mark Johnston To: Subbsd Cc: allanjude@freebsd.org, freebsd-current Current Subject: Re: ZFS perfomance regression in FreeBSD 12 APLHA3->ALPHA4 Message-ID: <20180906002825.GB77324@raichu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Sep 2018 00:28:31 -0000 On Wed, Sep 05, 2018 at 11:15:03PM +0300, Subbsd wrote: > On Wed, Sep 5, 2018 at 5:58 PM Allan Jude wrote: > > > > On 2018-09-05 10:04, Subbsd wrote: > > > Hi, > > > > > > I'm seeing a huge loss in performance ZFS after upgrading FreeBSD 12 > > > to latest revision (r338466 the moment) and related to ARC. > > > > > > I can not say which revision was before except that the newver.sh > > > pointed to ALPHA3. > > > > > > Problems are observed if you try to limit ARC. In my case: > > > > > > vfs.zfs.arc_max="128M" > > > > > > I know that this is very small. However, for two years with this there > > > were no problems. > > > > > > When i send SIGINFO to process which is currently working with ZFS, i > > > see "arc_reclaim_waiters_cv": > > > > > > e.g when i type: > > > > > > /bin/csh > > > > > > I have time (~5 seconds) to press several times 'ctrl+t' before csh is executed: > > > > > > load: 0.70 cmd: csh 5935 [arc_reclaim_waiters_cv] 1.41r 0.00u 0.00s 0% 3512k > > > load: 0.70 cmd: csh 5935 [zio->io_cv] 1.69r 0.00u 0.00s 0% 3512k > > > load: 0.70 cmd: csh 5935 [arc_reclaim_waiters_cv] 1.98r 0.00u 0.01s 0% 3512k > > > load: 0.73 cmd: csh 5935 [arc_reclaim_waiters_cv] 2.19r 0.00u 0.01s 0% 4156k > > > > > > same story with find or any other commans: > > > > > > load: 0.34 cmd: find 5993 [zio->io_cv] 0.99r 0.00u 0.00s 0% 2676k > > > load: 0.34 cmd: find 5993 [arc_reclaim_waiters_cv] 1.13r 0.00u 0.00s 0% 2676k > > > load: 0.34 cmd: find 5993 [arc_reclaim_waiters_cv] 1.25r 0.00u 0.00s 0% 2680k > > > load: 0.34 cmd: find 5993 [arc_reclaim_waiters_cv] 1.38r 0.00u 0.00s 0% 2684k > > > load: 0.34 cmd: find 5993 [arc_reclaim_waiters_cv] 1.51r 0.00u 0.00s 0% 2704k > > > load: 0.34 cmd: find 5993 [arc_reclaim_waiters_cv] 1.64r 0.00u 0.00s 0% 2716k > > > load: 0.34 cmd: find 5993 [arc_reclaim_waiters_cv] 1.78r 0.00u 0.00s 0% 2760k > > > > > > this problem goes away after increasing vfs.zfs.arc_max > > > _______________________________________________ > > > freebsd-current@freebsd.org mailing list > > > https://lists.freebsd.org/mailman/listinfo/freebsd-current > > > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > > > > > > > Previously, ZFS was not actually able to evict enough dnodes to keep > > your arc_max under 128MB, it would have been much higher based on the > > number of open files you had. A recent improvement from upstream ZFS > > (r337653 and r337660) was pulled in that fixed this, so setting an > > arc_max of 128MB is much more effective now, and that is causing the > > side effect of "actually doing what you asked it to do", in this case, > > what you are asking is a bit silly. If you have a working set that is > > greater than 128MB, and you ask ZFS to use less than that, it'll have to > > constantly try to reclaim memory to keep under that very low bar. > > > > Thanks for comments. Mark was right when he pointed to r338416 ( > https://svnweb.freebsd.org/base/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c?r1=338416&r2=338415&pathrev=338416 > ). Commenting aggsum_value returns normal speed regardless of the rest > of the new code from upstream. > I would like to repeat that the speed with these two lines is not just > slow, but _INCREDIBLY_ slow! Probably, this should be written in the > relevant documentation for FreeBSD 12+ Could you please retest with the patch below applied, instead of reverting r338416? diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c index 2bc065e12509..9b039b7d4a96 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c @@ -538,7 +538,7 @@ typedef struct arc_state { */ int zfs_arc_meta_prune = 10000; unsigned long zfs_arc_dnode_limit_percent = 10; -int zfs_arc_meta_strategy = ARC_STRATEGY_META_BALANCED; +int zfs_arc_meta_strategy = ARC_STRATEGY_META_ONLY; int zfs_arc_meta_adjust_restarts = 4096; /* The 6 states: */