From owner-freebsd-emulation@freebsd.org Thu Nov 17 11:51:31 2016 Return-Path: Delivered-To: freebsd-emulation@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4479C468FB for ; Thu, 17 Nov 2016 11:51:31 +0000 (UTC) (envelope-from arcade@b1t.name) Received: from limbo.b1t.name (limbo.b1t.name [78.25.32.206]) by mx1.freebsd.org (Postfix) with ESMTP id 713501815 for ; Thu, 17 Nov 2016 11:51:29 +0000 (UTC) (envelope-from arcade@b1t.name) Received: from [172.29.1.142] (probe.42.lan [172.29.1.142]) by limbo.b1t.name (Postfix) with ESMTPSA id CC19965 for ; Thu, 17 Nov 2016 13:42:53 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=b1t.name; s=mail; t=1479382975; bh=n5rfwi8S1Hi+bo0hy7O45p53eIraMSEHqKAxridvaRc=; h=Subject:To:References:From:Date:In-Reply-To; b=w5M/sw5tSquZdbWiNawEjYZj+74GQ+fas4xJyZW+A1c6rnfRWqMgaVbaLEET1cRRc vDgAA5X4RJ2etb7xBUIaDlUy7aPWM6JaOz3HTiZfUfTtu3OrzK6X6fp3JQ5d3AbxcI BmnbWU8sIiEcgzxJjc7mEOtoWiBzCnaG4GT7mYKs= Subject: Re: bhyve: zvols for guest disk - yes or no? To: freebsd-emulation@freebsd.org References: <5be68f57-c9c5-7c20-f590-1beed55fd6bb@rlwinm.de> From: Volodymyr Kostyrko Message-ID: <582D97BC.8030801@b1t.name> Date: Thu, 17 Nov 2016 13:42:52 +0200 User-Agent: Mozilla/5.0 (X11; DragonFly x86_64; rv:43.0) Gecko/20100101 Firefox/43.0 SeaMonkey/2.40 MIME-Version: 1.0 In-Reply-To: <5be68f57-c9c5-7c20-f590-1beed55fd6bb@rlwinm.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2016 11:51:31 -0000 Jan Bramkamp wrote: > An other thing I learned the hard way is that ZVOL are set in stone at > the ZVOL creation. You have to (cam)dd everything to change the block > size. The default ZVOL block size is 8K which isn't wrong but your > guests need to align their file systems (and swap) correctly or you'll > suffer from write amplification. And ZFS RAID-Z really sucks for such > small block sizes. Use mirrored VDEVs in your pools or you will suffer > from massive metadata overhead and disappointing IOPS. This pole has two ends though. When you are working with file system default 8k block size is too small. Setting it up to 64k will save a lot writes for host. This is due to most current filesystems do work correctly with extents/big blocks: * Linux: ext4, xfs - full support; * BSD: ufs - disabled, need to be enabled on format, zfs - full support; * NTFS: no support, but you can use 64k blocks with Win XP - Win 10 (though Win XP can't boot off such partition). Setting block size bigger makes fragmentation less common (check your `zpool list`) and saves writes. When guest writes one 64k chunk ZFS writes 8 separate 8k blocks (+ metadata and stuff) and this is not good for the speed. On the opposite when you have some database inside VM you need to prepare disk for it accordingly. Guides for using PostgreSQL and MySQL apply to VM's too. MSSQL on the other hand uses 64k extents to work with database internally so raising block size to 64k would be good for it. -- Sphinx of black quartz judge my vow.