From owner-freebsd-hackers@freebsd.org Fri Feb 22 15:11:32 2019 Return-Path: Delivered-To: freebsd-hackers@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 5CBF614EF30E for ; Fri, 22 Feb 2019 15:11:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (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 7633170A47 for ; Fri, 22 Feb 2019 15:11:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x844.google.com with SMTP id w4so2861077qtc.1 for ; Fri, 22 Feb 2019 07:11:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=V8OCl07guw0XtkHXPDip/rTM8r7J0f0bGRt/UkJ8Dik=; b=uTbRd7i6erOZj4bNA1i6UdQvKZBV/p70GDqrLCORMblSLOff5WAZ6eW0+epk+7kthA 0s76ueUGje/pL8I4a1+av6WaZAQNAwEy8rVVRc2dpPAXD92jmWoHssN6xZNr/sy6xq0s yACO5OD6eziQ4YiqnJJKi3reiH0MThzPnLkK92I11npzRXoVHKWNOSMuDDdHXJSVhmRS QnRGSJQIYVA6lDBQFClE6FKcaizAOn8QVoP4qP1/HHQVUlGsBLPoNWEgZK1jQechI+Q8 KNk9EbNvlqhOFCxL2tzhcLcF2wLZAIRjjJuherw+TQH9vba+xvHAYyeHsHS7rbA55hpK FwyA== 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=V8OCl07guw0XtkHXPDip/rTM8r7J0f0bGRt/UkJ8Dik=; b=kDj5J0KIi4EJoZ0CgYueQZGdzslEtUPGmzaKM+lroTNb6xxFrmm1+EH5yd5ZCU8Z79 YRJ0wY84g2oWPd6RJ91dyvPBU+WUq54uynXgva18/j/tS6pCltnoH0WL80l/baRA00c+ uXlo4+kgwgfP+6sJEtgtP+BlQyWlRGZQ8F/dewIK4V6KEpYq3c9bOKxRJf/qSIagNnd9 7BCbdFJpdRH7aVlvxqSLSY3tGMXW2jKBhO+qfKebAAKHXR0et4ONq7jloqW04k3xPbAC /A7l2H724IkNTXCGiLCMhSdReizefDHgSggrBnwfSpvB3FF2Oh3U4H/4MxXmqeHjeMTz YPkw== X-Gm-Message-State: AHQUAub5097D/blp17FohDptAiqFab2xsDIfWFzDNLQmvcktjs9VwmBF 8CB1tJNsQYyULw9l8R/a2mp1F90kGAKeIqDaUujCrbtdSRM= X-Google-Smtp-Source: AHgI3Iav2v4Rk6NaqIEO0PbJjyvH+9ZacmZ1toX+e+yXQmfVHNqITjzy+s3kkEO+d+GgxsQKzR/Lb5I7x4cTUm68L3A= X-Received: by 2002:ac8:35f8:: with SMTP id l53mr3529058qtb.15.1550848290940; Fri, 22 Feb 2019 07:11:30 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Warner Losh Date: Fri, 22 Feb 2019 08:11:19 -0700 Message-ID: Subject: Re: Any ideal way to run FIO benchmarking for NVMEe devices in FreeBSD To: Alan Somers Cc: Rebecca Cran , Rajesh Kumar , FreeBSD Hackers X-Rspamd-Queue-Id: 7633170A47 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=uTbRd7i6 X-Spamd-Result: default: False [-1.68 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.89)[-0.887,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_SPAM_SHORT(0.21)[0.210,0]; NEURAL_HAM_LONG(-0.91)[-0.910,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[4.4.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; IP_SCORE(-0.08)[ip: (4.27), ipnet: 2607:f8b0::/32(-2.62), asn: 15169(-1.99), country: US(-0.07)]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2019 15:11:32 -0000 On Fri, Feb 22, 2019 at 8:04 AM Alan Somers wrote: > On Fri, Feb 22, 2019 at 5:29 AM Rebecca Cran via freebsd-hackers > wrote: > > > > On 2/22/19 1:51 AM, Rajesh Kumar wrote: > > > 1. Should we use "posixaio" as the ioengine (or) something else? > > > 2. Should we use single thread (or) multiple threads for test? If > > > multiple threads, how can we decide on the optimal thread count? > > > 3. Should we use "raw device files" (Eg: nvme namespace file - > > > /dev/nvme0ns1) without filesystem (or) use a mounted filesystem > with a > > > regular file (Eg: /mnt/nvme/test1). Looks like raw device files > give better > > > numbers. > > > 4. Should we use a shared file (or) one file per thread? > > > 5. I believe 1Job should be fine for benchmarking. (or) should we > try > > > multiple jobs? > > > > > > I just ran a quick test on a filesystem on my machine which has an M.2 > > NVMe drive, and it seems posixaio performs pretty poorly compared to the > > sync ioengine: around 700 MB/s vs. 1100 MB/s! > > When AIO is run on a filesystem, it uses an internal thread pool to > process requests. But if you run it on a bare drive, then the I/O is > direct and should be faster than the sync ioengine. > Here's the script I typically use to get first pass raw numbers. The key to getting good benchmark numbers is getting as many I/O requests on the device as possible. At present, posixaio is the only thing outside of the kernel that can do that. I usually get close to datasheet numbers using this test: ; SSD testing: 128k I/O 64 jobs 32 deep queue [global] direct=1 rw=randread refill_buffers norandommap randrepeat=0 bs=128k ioengine=posixaio iodepth=128 numjobs=64 runtime=30 group_reporting thread [nvme128k] And I agree with Alan: to get the best numbers, you need to go to the raw device. I've not cared about from userland I/O performance, so I've not looked at making the UFS or ZFS cases work better in fio. Warner > > > I _was_ going to suggest using posixaio and setting iodepth to something > > like 32, but since it performs badly I'd suggest playing around with the > > numjobs parameter and seeing where the best performance is achieved - > > whether that's latency or throughput. > > > > > > On my system, single-threaded achieves ~530 MB/s, 8 jobs/threads 1150 > > MB/s and 32 1840 MB/s with a 4 KB block size. > > > > Bumping the block size from 4 KB to 16 KB makes the throughput more > > jumpy, but appears to average 2300 MB/s when used with 32 jobs. > > > > > > -- > > Rebecca Cran > > > > _______________________________________________ > > freebsd-hackers@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > To unsubscribe, send any mail to " > freebsd-hackers-unsubscribe@freebsd.org" > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >