
Hi Russell, From: "Russell Coker" <russell@coker.com.au>
I've got a virtual server running MySQL where I'm going to convert the Dom0 to ZFS. Currently the Dom0 exports a LVM volume to the DomU which uses Ext4 for the database. My options are to use a ZFS zvol instead of a LV for the Ext4 filesystem or to use a ZFS filesystem that is NFS exported.
There may be a third option: Running MySQL in a Linux container. This way the "Dom0" is sharing the kernel with the "DomU" and provides the filesystem directly, without any layer in-between. Definitely a plus for a database server. It's the setup I use with FreeBSD and jails and it works well. In some cases it is worth to consider whether you need OS virtualisation at all. E.g. database servers on dedicated hardware shared by multiple instances. I agree with Arjen to stay away from NFS. Partially because of the way NFS adds networking and locking over it and all that complexity (and potential implementation problems and bugs..) I see issues reported around ZFS and NFS under FreeBSD but I did not bother to look into it - I don't use it that way (and can afford to avoid it;-) Arjen, I am surprised to hear the ZFS is faster than ext4. I did not benchmark (the performance is "good enough" for my purposes) but I believed a COW system isn't the best for databases. Regards Peter

On 17/06/13 09:40, Petros wrote:
Hi Russell,
From: "Russell Coker" <russell@coker.com.au>
I've got a virtual server running MySQL where I'm going to convert the Dom0 to ZFS. Currently the Dom0 exports a LVM volume to the DomU which uses Ext4 for the database. My options are to use a ZFS zvol instead of a LV for the Ext4 filesystem or to use a ZFS filesystem that is NFS exported.
There may be a third option: Running MySQL in a Linux container. This way the "Dom0" is sharing the kernel with the "DomU" and provides the filesystem directly, without any layer in-between. Definitely a plus for a database server.
It's the setup I use with FreeBSD and jails and it works well.
In some cases it is worth to consider whether you need OS virtualisation at all. E.g. database servers on dedicated hardware shared by multiple instances.
I agree with Arjen to stay away from NFS. Partially because of the way NFS adds networking and locking over it and all that complexity (and potential implementation problems and bugs..)
I see issues reported around ZFS and NFS under FreeBSD but I did not bother to look into it - I don't use it that way (and can afford to avoid it;-)
Arjen, I am surprised to hear the ZFS is faster than ext4. I did not benchmark (the performance is "good enough" for my purposes) but I believed a COW system isn't the best for databases.
I've noticed ZFS performing very well for databases as well, and wrote a blog post about it: http://blog.dryft.net/2011/09/benchmarking-zfs-xfs-ext4-and-btrfs.html My blog post also notes that I have my suspicions about WHY it's faster -- that perhaps it is not using i/o barriers. I don't know if that has any implications for data write assurances or not in the ZFS COW model; it's quite possible that it's actually safe to not use barriers, and thus gain a big performance boost. Does anyone here know more about this? PS. That round of benchmarking was in 2011, when zfs was not particularly mature on Linux; the situation may have changed by now.

On Mon, 17 Jun 2013, Petros <Petros.Listig@fdrive.com.au> wrote:
From: "Russell Coker" <russell@coker.com.au>
I've got a virtual server running MySQL where I'm going to convert the Dom0 to ZFS. Currently the Dom0 exports a LVM volume to the DomU which uses Ext4 for the database. My options are to use a ZFS zvol instead of a LV for the Ext4 filesystem or to use a ZFS filesystem that is NFS exported.
There may be a third option: Running MySQL in a Linux container. This way the "Dom0" is sharing the kernel with the "DomU" and provides the filesystem directly, without any layer in-between. Definitely a plus for a database server.
I have idly considered using containers for that system. For the more complex DomUs I wouldn't do it, also if I was to have multiple servers for the same service then I wouldn't do it to avoid any risk of the wrong server binding to a particular IP address. But as I've only got one single MySQL server in the network in question and a MySQL server is a fairly simple system (in terms of the range of things that a server might do) it might be a good option. Also the MySQL server in question is still running RHEL4. Out of all the DomUs there is one which has some MySQL client processes which wouldn't talk to a newer version of mysqld last time I tested. Eventually I want to upgrade to Debian/Wheezy for the MySQL server which means a dump/restore. Using ZFS in a container for performance would be a significant benefit for that operation.
Arjen, I am surprised to hear the ZFS is faster than ext4. I did not benchmark (the performance is "good enough" for my purposes) but I believed a COW system isn't the best for databases.
On Mon, 17 Jun 2013, Toby Corkindale <toby.corkindale@strategicdata.com.au> wrote:
http://blog.dryft.net/2011/09/benchmarking-zfs-xfs-ext4-and-btrfs.html
My blog post also notes that I have my suspicions about WHY it's faster -- that perhaps it is not using i/o barriers. I don't know if that has any implications for data write assurances or not in the ZFS COW model; it's quite possible that it's actually safe to not use barriers, and thus gain a big performance boost.
Toby has written about the ZFS performance. It seems that ZFS gains write performance from advanced caching and read performance doesn't matter so much nowadays as RAM is cheap and the working set will usually be in cache. -- My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/
participants (3)
-
Petros
-
Russell Coker
-
Toby Corkindale