From owner-freebsd-virtualization@FreeBSD.ORG Mon May 11 04:30:45 2015 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8DDB8793 for ; Mon, 11 May 2015 04:30:45 +0000 (UTC) Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com [IPv6:2a00:1450:400c:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 26736168C for ; Mon, 11 May 2015 04:30:45 +0000 (UTC) Received: by wizk4 with SMTP id k4so90116946wiz.1 for ; Sun, 10 May 2015 21:30:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=SXGuz0CBJPVCXPMmasv3B10+gPhQwi6I2CvyTFbxO18=; b=FGc53NmEpSMqfoNcdTxiIdyUGQ2Zy32XK3CDHOEg8QFqJP9lTRCc87TdsWGwW9QNzD vzCtY96Tclr4wn+UwskwcfvsxY/uKXO4VeE1lhUwwqgXL4U1cgEsomDP7uQxqulNZqz0 bOJv8sD5n0vB+ePolV/aJqRgvbdM+g1wic6X1xQbzxoQjBOh1AYUMNqj4CU/f48vFGM0 Okr7KfoguzumwaTgwnzJHJq7cWZIwm7uftCbwB9xn6lBwtj7/fMME4npm4tzYvj00IAJ 4efP+pKZP0w7yo5CV5jMn+uBdLS7g5ZcwIGwJ5cqjSw3O7GssLobmSfD+5dYxrAEYimS rmeg== MIME-Version: 1.0 X-Received: by 10.194.204.230 with SMTP id lb6mr16341829wjc.63.1431318642830; Sun, 10 May 2015 21:30:42 -0700 (PDT) Received: by 10.27.52.18 with HTTP; Sun, 10 May 2015 21:30:42 -0700 (PDT) In-Reply-To: References: <7dd04a4cec612d18110a00b9020fd948@openmailbox.org> Date: Sun, 10 May 2015 21:30:42 -0700 Message-ID: Subject: Re: Is the BHyVe guest as suitable for high-performance disk IO as the host? From: Neel Natu To: Tinker Cc: "freebsd-virtualization@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2015 04:30:45 -0000 Hi Tinker, On Sun, May 10, 2015 at 6:16 AM, Tinker wrote: > Hi Neel, > > Thank you very much for your response - > > That's great! > > I guess this should deliver the full capacity for basically any IO system > around, be it a fast SSD or ramdisk. (Since the guest may not need to flush > data immediately to the host, I guess read performance is the more sensitive > point.) > > Which disk emulation mode is best for a BSD guest, "virtio-blk" or > "ahci-hd"? > You'll need to experiment because there are so many moving pieces: the guest driver implementation, VM exit overhead, capabilities of a emulated disk controller. From the narrow perspective of VM-exit overhead 'virtio-blk' is better because the CPU decodes all the information needed to handle the I/O exit. > In general, should any other consideration be made for performance (using > the "direct" or "nocache" BHyVe configuration options, particular > consideration for proper sector alignment when using a disk image stored on > the host's SSD-based ZFS, mounting the host ZFS filesystem with "noatime")? > Using "nocache" will prevent double-buffering of the virtual disk file in the host. Using "direct" will guarantee consistency of the virtual disk file on the underlying storage device. If you are purely focused on performance then don't use either option but be aware that you'll be using buffer cache on the host and also that the guest filesystem could be corrupted on an unplanned host shutdown. With respect to alignment I am not sure if you can request a specific alignment when creating a flat file for the virtual disk. However, if you use a ZVOL as a backing device then it can be created on top of a partition which has the correct alignment. best Neel > Kind regards, > Tinker > > > On 2015-05-10 04:03, Neel Natu wrote: >> >> Hi Tinker, >> >> On Sat, May 9, 2015 at 9:49 AM, Tinker wrote: >>> >>> Hi! >>> >>> For an environment with very heavy parallell IO, should the performance >>> be >>> just as good in a BHyVe guest as in the FreeBSD host environment? >>> >>> What I thought of is that I guess within the host environment, the >>> storage >>> subsystem should have all kinds of optimizations like an internal work >>> queue >>> that pushes lots of work alinearly/asynchronously to the disk controller >>> and >>> this way allows it, in turn, to give all its performance. >>> >>> Does the virtualized disk interface carry over all that goodness to the >>> guest? >>> >> >> bhyve creates 8 worker threads for each virtual disk controller (both >> ahci and virtio-blk). >> >> All guest I/O is handled asynchronously by these worker threads which >> provide parallelism. >> >>> (https://wiki.freebsd.org/bhyve seems to say yes, presuming you configure >>> BHyVe to run the virtual disk in AHCI mode?) >>> >> >> The wiki is out of date. >> >> Since r280037 the virtio-blk emulation also gets the benefits of using >> the block_if worker threads. >> >> best >> Neel >> >>> Thanks! >>> Tinker >>> >>> _______________________________________________ >>> freebsd-virtualization@freebsd.org mailing list >>> http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization >>> To unsubscribe, send any mail to >>> "freebsd-virtualization-unsubscribe@freebsd.org" > >