[mythtv-users] Poor performance with ZFS (ZFS on Linux)

Dan Wilga mythtv-users2 at dwilga-linux1.amherst.edu
Wed May 30 13:06:37 UTC 2018


On 5/29/18 10:43 PM, Stephen Baker wrote:
> On Tue, 2018-05-29 at 19:48 -0500, Rajil Saraswat wrote:
>> 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
>> https://github.com/zfsonlinux/zfs/issues/7573. If anybody else using
>> mythtv with ZFS successfully please can you share your mysql config
>> (/etc/mysql/my.cnf).
>>
>> Thanks
>
> I have no direct experience with ZFS on Linux. All of my experience is 
> on Solaris.
>
> I assume that you have a separate dataset for the database where the 
> block size matches the I/O block size of the database.
>
> 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.
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.

# zfs get compression,dedup my_zfs
NAME  PROPERTY     VALUE          SOURCE
my_zfs  compression  lz4            local
my_zfs  dedup        on             local

# zfs set compression=off my_zfs
# zfs set dedup=off my_zfs

Repeat your tests and re-enable whichever features need to be re-enabled.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20180530/44633f8e/attachment.html>


More information about the mythtv-users mailing list