From owner-freebsd-stable@freebsd.org Wed Jul 1 16:00:58 2020 Return-Path: Delivered-To: freebsd-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C049355CC9 for ; Wed, 1 Jul 2020 16:00:58 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-yb1-f193.google.com (mail-yb1-f193.google.com [209.85.219.193]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49xmD954V1z4h5K for ; Wed, 1 Jul 2020 16:00:57 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-yb1-f193.google.com with SMTP id y17so10111097ybm.12 for ; Wed, 01 Jul 2020 09:00:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pI4fUiPfxb00/zf2AjkO1Qo0FejzD9olJX6I6LspalE=; b=cEt4lbZkBi4x2Y0Xmlv5yL8hq1rKe9tAC0yywHb6PS+QqA+dwrI0O45iiIz2yEr45u MNDCaPKGXuOAf9eSveOZBeHZzp4FV3gONEpOWS3CCb3gOtAR2qXXHRxOs5JrftFMdtNh axMzrqmhUyacNkEM9gJGD4asVf9D77CrTDt4boOGibP9AbnoQnulkd5wqgIE8tvVuSik wVX4NyDPotV7SXE9L6v7/PafzTQvRZxyp2uGMH80a+CxABInqx299AstcYkTVkVUL88+ FRxxqZr1GsDXqbFr9NEYHOzqEJZxMo9n/gq3odaw3FQzIKK339kQDlr6gz9c6lX17Bij vmVg== X-Gm-Message-State: AOAM533ONq506/HemTd9+EALmSQijkc8+JCbDH8u+WkKZ/RBoTwzDqbI dmykUe6Cf14CwRV14kijEdJNrxhPaw1qSiN+YUs= X-Google-Smtp-Source: ABdhPJx09YP4etmD4vK4o9r7qGeuhVed+UHJ7vdF7HBAly2y1IJzR9ao8FxvO+Mp+1XILQZ90jsJmqso5BVccnZRimY= X-Received: by 2002:a05:6902:4a2:: with SMTP id r2mr44394730ybs.176.1593619254113; Wed, 01 Jul 2020 09:00:54 -0700 (PDT) MIME-Version: 1.0 References: <20200701130649.0b0643d5@i11.co> <20200701150654.74775e56@i11.co> In-Reply-To: <20200701150654.74775e56@i11.co> From: Li-Wen Hsu Date: Thu, 2 Jul 2020 00:00:42 +0800 Message-ID: Subject: Re: BerkeleyDB Hash vs Btree on FreeBSD and Linux To: Nick Kostirya Cc: freebsd-stable@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49xmD954V1z4h5K X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of lwhsufreebsd@gmail.com designates 209.85.219.193 as permitted sender) smtp.mailfrom=lwhsufreebsd@gmail.com X-Spamd-Result: default: False [-2.36 / 15.00]; FROM_NEQ_ENVFROM(0.00)[lwhsu@freebsd.org,lwhsufreebsd@gmail.com]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-0.97)[-0.966]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-stable@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.41)[-0.412]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[209.85.219.193:from]; NEURAL_HAM_MEDIUM(-0.98)[-0.981]; FORGED_SENDER(0.30)[lwhsu@freebsd.org,lwhsufreebsd@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.219.193:from]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2020 16:00:58 -0000 On Wed, Jul 1, 2020 at 8:07 PM Nick Kostirya via freebsd-stable wrote: > > On Wed, 1 Jul 2020 18:20:19 +0800 > Li-Wen Hsu wrote: > > > On Wed, Jul 1, 2020 at 6:07 PM Nick Kostirya via freebsd-stable > > wrote: > > > > > > Hello. > > > > > > I noticed that BerkeleyDB Hash is VERY slow compared to BerkeleyDB Btree on FreeBSD (UFS or ZFS). > > > But they (Hash and Btree) have roughly the same performance on Linux. > > > > > > Why? > > > > It's not an easy question, do you have more information about the test > > environment setup, and the statistics of the results? Any information about this? > > I'd recommend using some analysis tools like DTrace to check what it's busy for. > > > The top show getblk status often. > > Please tell me what you can and how to look with DTrace. > > I use > dtrace -n '::: /execname == "a.out"/ { @[probefunc] = count(); }' > > but I do not see the difference between Hash and Btree. I would say check the flame graph: http://www.brendangregg.com/blog/2015-03-10/freebsd-flame-graphs.html There is benchmarks/flamegraph port but I haven't used it for a while. Li-Wen