Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Nov 2016 13:42:52 +0200
From:      Volodymyr Kostyrko <arcade@b1t.name>
To:        freebsd-emulation@freebsd.org
Subject:   Re: bhyve: zvols for guest disk - yes or no?
Message-ID:  <582D97BC.8030801@b1t.name>
In-Reply-To: <5be68f57-c9c5-7c20-f590-1beed55fd6bb@rlwinm.de>
References:  <D991D88D-1327-4580-B6E5-2D59338147C0@punkt.de> <b775f684-98a2-b929-2b13-9753c95fd4f2@rlwinm.de> <D5A6875B-A2AE-4DD9-B941-71146AEF2578@punkt.de> <5be68f57-c9c5-7c20-f590-1beed55fd6bb@rlwinm.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?582D97BC.8030801>