Comments on: Hands-On Look at ZFS with MySQL https://www.percona.com/blog/hands-look-zfs-with-mysql/ Tue, 06 Aug 2019 20:04:00 +0000 hourly 1 https://wordpress.org/?v=6.5.2 By: Bajrang Panigrahi https://www.percona.com/blog/hands-look-zfs-with-mysql/#comment-10970057 Thu, 13 Dec 2018 10:51:21 +0000 https://www.percona.com/blog/?p=46270#comment-10970057 Awesome, Nice write up., Good to learn the POC – MySQL on ZFS.

Thanks @Yves. 🙂

]]>
By: chris scott https://www.percona.com/blog/hands-look-zfs-with-mysql/#comment-10969562 Wed, 15 Aug 2018 12:45:36 +0000 https://www.percona.com/blog/?p=46270#comment-10969562 Also bear in mind the command is executed where the mysql client is run, not on the server itself, so if you are connecting from a remote box it wont work.

]]>
By: Yves Trudeau https://www.percona.com/blog/hands-look-zfs-with-mysql/#comment-10968950 Mon, 05 Feb 2018 15:30:43 +0000 https://www.percona.com/blog/?p=46270#comment-10968950 That’s strange and certainly a good reason to leave Innodb checksum enabled. Thanks

]]>
By: Federico https://www.percona.com/blog/hands-look-zfs-with-mysql/#comment-10968949 Sat, 03 Feb 2018 19:23:32 +0000 https://www.percona.com/blog/?p=46270#comment-10968949 Yves, at Catawiki when I disabled InnoDB checksums in our 3 ZFS slaves we had InnoDB logs corrupted on all of them. Snapshots were unusable. A scrub encountered no checksums inconsistencies on the ZFS side. I still don’t know what the problem was, but InnoDB checksums seem to be still relevant (as Peter wrote).

]]>
By: Yves Trudeau https://www.percona.com/blog/hands-look-zfs-with-mysql/#comment-10968804 Fri, 15 Dec 2017 19:37:01 +0000 https://www.percona.com/blog/?p=46270#comment-10968804 @Jon, all what you wrote is fine, thanks. Of course using shm for the SLOG or the L2ARC makes no sense for any real use cases. But you kind of miss the point, this post is a hands-on. My goal is to show how to add a SLOG and a L2ARC and the use of a file in shm was easy. I’ll be targeting performance and more realistic configurations in future posts.

]]>
By: Jon Strabala https://www.percona.com/blog/hands-look-zfs-with-mysql/#comment-10968796 Thu, 14 Dec 2017 22:32:43 +0000 https://www.percona.com/blog/?p=46270#comment-10968796 Why make a SLOG (device for the ZIL) or a L2ARC in shared memory at all?

You say “to speed MySQL on ZFS drastically” but all you are doing is creating more “double writes”.

ZFS has a flag ‘sync’ that can be set to sync=disabled thus completely bypassing ZIL – yes don’t do this in production

from: http://milek.blogspot.com/2010/05/zfs-synchronous-vs-asynchronous-io.html

Synchronous requests are disabled. File system transactions
only commit to stable storage on the next DMU transaction group
commit which can be many seconds. This option gives the
highest performance. However, it is very dangerous as ZFS
is ignoring the synchronous transaction demands of
applications such as databases or NFS.

Also ARC (level one) is in RAM why in the world would you make a L2ARC in shared memory which is RAM if you don’t overflow and if you do overflow you need a disk backing store, just increase the size of ARC why have double caching with LRU logic running?. Lets just say you want to use 2/3 of your RAM in a 32GB system then to get 24GB just alter options zfs zfs_arc_max=25769803776

from: https://www.zfsbuild.com/2010/04/15/explanation-of-arc-and-l2arc/

As a general rule, you want to install as much RAM
into the server as you can to make the ARC as big as
possible. At some point, adding more memory is just
cost prohibitive. That is where the L2ARC becomes
important. The L2ARC is the second level adaptive
replacement cache. The L2ARC is often called “cache
drives” in the ZFS systems.

So you want more performance (at the expense of data reliability) just set sync=disabled and then use more ram for L2ARC. The addition of shared memory images as a slog and a l2arc device while interesting isn’t practical for hitting the highest benchmark scores.

However I grant that what you did might be very useful for looking at use patterns of the devices when such devices don’t really exist.

On other comment I have yet to see any real benchmark of disk performance throughput using gzip beet lz4, yes gzip can compress more but the overhead of the gzip algorithm is much more than lz4 and can really create a bottleneck.

]]>
By: Yves Trudeau https://www.percona.com/blog/hands-look-zfs-with-mysql/#comment-10968787 Wed, 13 Dec 2017 16:53:47 +0000 https://www.percona.com/blog/?p=46270#comment-10968787 There is no Percona ZFS reference architecture. Common sense would lead to the use Enterprise SSDs for high volume applications but that so much depends on the use case. There are even still cases where big spinners makes sense. Coming back to compression, if gzip packs 25% more data in a fast NVMe card, that’s quite interesting.

]]>
By: chrone https://www.percona.com/blog/hands-look-zfs-with-mysql/#comment-10968786 Wed, 13 Dec 2017 16:43:19 +0000 https://www.percona.com/blog/?p=46270#comment-10968786 I see, that’s why. Do you guys running on Enterprise SSD or Consumer SSD. Is there a recommended SSD for Percona referenced architecture?

]]>
By: Yves Trudeau https://www.percona.com/blog/hands-look-zfs-with-mysql/#comment-10968785 Wed, 13 Dec 2017 16:37:36 +0000 https://www.percona.com/blog/?p=46270#comment-10968785 First, gzip compresses way more than lz4 so if the IO bandwidth is the limiting performance factor over CPU, then performance is better with gzip. That has to be balanced of course, if your CPUs runs hot, lz4 would be a better choice. In a recent experiment I did (will eventually blog about it), about 110GB of InnoDB data compressed to 31.5GB with gzip but only 43.7GB is lz4. That was 979M rows dataset. Insertion time using gzip was actually 3% smaller than using lz4…

]]>
By: chrone https://www.percona.com/blog/hands-look-zfs-with-mysql/#comment-10968783 Tue, 12 Dec 2017 19:30:12 +0000 https://www.percona.com/blog/?p=46270#comment-10968783 Nice write up! 🙂

I wonder why you guys use gzip instead of lz4 for ZFS compression. Also for pool without SLOG, I found logbias=throughput has higher performance.

Looking forward for MySQL best practices on Linux VM running on top of ZFS ZVOL.

]]>
By: Peter Zaitsev https://www.percona.com/blog/hands-look-zfs-with-mysql/#comment-10968772 Fri, 08 Dec 2017 15:53:28 +0000 https://www.percona.com/blog/?p=46270#comment-10968772 These are use cases
1) Problems during file manipulations (bugs in tools ranging from compression utilities to network copy)
2) Some of the bugs in Innodb
3) Some of the bugs in ZFS/Kernel

]]>
By: Petr Stastny https://www.percona.com/blog/hands-look-zfs-with-mysql/#comment-10968771 Fri, 08 Dec 2017 15:39:27 +0000 https://www.percona.com/blog/?p=46270#comment-10968771 I think the point is that when InnoDB file is somehow corrupted for example during network transfer, ZFS won’t detect that, but checksum inside InnoDB data file will. Also when you write something from outside to InnoDB file by mistake, ZFS will not argue because ZFS does not care about internal InnoDB data structures. But InnoDB checksums do.

]]>
By: Yves Trudeau https://www.percona.com/blog/hands-look-zfs-with-mysql/#comment-10968770 Fri, 08 Dec 2017 15:22:04 +0000 https://www.percona.com/blog/?p=46270#comment-10968770 Indeed the overhead is small, it just wonder what is the benefits of two checksums.

]]>
By: Yves Trudeau https://www.percona.com/blog/hands-look-zfs-with-mysql/#comment-10968769 Fri, 08 Dec 2017 15:17:52 +0000 https://www.percona.com/blog/?p=46270#comment-10968769 There should be a backslash “\” in front of the “!”, this is the mysql client subshell command. I’ll modify.

]]>
By: Peter Zaitsev https://www.percona.com/blog/hands-look-zfs-with-mysql/#comment-10968768 Fri, 08 Dec 2017 15:01:22 +0000 https://www.percona.com/blog/?p=46270#comment-10968768 While I believe disabling double write makes sense with ZFS as it ensures writes are atomic, I do not believe file system checksums are complete replacement for Innodb checksums. There have been number of cases over years when Innodb would corrupt its own pages data get corrupted some other way, for example while using netcat to copy it over network.

Modern CPU optimized CRC32 checksums are pretty cheap and I do not think it is worth to disable them (unlike Doublewrite which is expensive)

]]>
By: Petr Stastny https://www.percona.com/blog/hands-look-zfs-with-mysql/#comment-10968767 Fri, 08 Dec 2017 08:37:43 +0000 https://www.percona.com/blog/?p=46270#comment-10968767 I don’t understand how snapshot command works:

# mysql -e ‘flush tables with read lock;show master status;! zfs snapshot -r mysqldata/mysql@my_first_snapshot’

Do you call shell command from mysql client? It does not work for me (I use MariaDB).

I understand that MySQL connection can not be closed to keep the read lock, but I don’t know how to do it on shell while calling zfs command to create snapshot.

]]>
By: Petr Stastny https://www.percona.com/blog/hands-look-zfs-with-mysql/#comment-10968766 Fri, 08 Dec 2017 08:33:13 +0000 https://www.percona.com/blog/?p=46270#comment-10968766 Is it really safe to use innodb_doublewrite = 0 ? Your previous blog posts about disabling innodb_doublewrite ended in warning like “Update: do not do this, this has been proven to corrupt data!”.

]]>