<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 5/29/18 10:43 PM, Stephen Baker wrote:<br>
    <blockquote type="cite"
      cite="mid:1527648220.7443.16.camel@wildwood.baker.org">
      <div>On Tue, 2018-05-29 at 19:48 -0500, Rajil Saraswat wrote:</div>
      <blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px
        #729fcf solid;padding-left:1ex">
        <pre>Hello,

I have setup a new setup with root on ZFS. Unfortunately, mariadb is
performing quite poorly on ZFS compared with an Ext4 file system.  I
have filed a issue about this at
<a href="https://github.com/zfsonlinux/zfs/issues/7573" moz-do-not-send="true">https://github.com/zfsonlinux/zfs/issues/7573</a>. If anybody else using
mythtv with ZFS successfully please can you share your mysql config
(/etc/mysql/my.cnf).

Thanks
</pre>
      </blockquote>
      <div>
        <div><br>
        </div>
        <div>I have no direct experience with ZFS on Linux. All of my
          experience is on Solaris.</div>
        <div><br>
        </div>
        <div>I assume that you have a separate dataset for the database
          where the block size matches the I/O block size of the
          database.</div>
        <div><br>
        </div>
        <div>There are a number of reasons that ZFS will perform poorly.
          The top two reasons that I experienced are zpool >80% full
          and elevator seeks by the disk driver. In the first case, the
          free space allocation switches from track allocation to block
          allocation, which causes high fragmentation in the storage;
          sequential reads of a file become random reads on the disk.
          There is no need to belabor the performance differences
          between sequential and random I/O. In the second case, high
          locality of disk operations will cause I/O starvation for the
          locality outliers. The recommendations that I have are keep
          zpool <80% full a/o change the appropriate kernel tuneable,
          and change the disk optimizer from elevator to FIFO.</div>
      </div>
    </blockquote>
    In addition to the well thought-out advice of Stephen, I'll mention
    that there are two features of ZFS which can also reduce its
    performance significantly: compression and deduplication. If you
    have either of these enabled, you can easily try disabling them
    temporarily.<br>
    <br>
    # zfs get compression,dedup my_zfs<br>
    NAME  PROPERTY     VALUE          SOURCE<br>
    my_zfs  compression  lz4            local<br>
    my_zfs  dedup        on             local<br>
    <br>
    # zfs set compression=off my_zfs<br>
    # zfs set dedup=off my_zfs<br>
    <br>
    Repeat your tests and re-enable whichever features need to be
    re-enabled.<br>
  </body>
</html>