UI lag and jerky mouse

New to OpenZFS on OS X (Or ZFS in general)? Ask your questions here!

UI lag and jerky mouse

Postby cmckay » Wed Jun 08, 2016 11:51 am

Hello, I'm brand new to zfs. I succesffully got a pool and a zvol setup (formatted to hfs+) and all is sort of working. I'm having UI lag issues.

When the filesystem is under heavy load, eg, a big finder copy of data, the performance varies a lot, even if I try the same copy over and over, from 30Mb/sec up to 180Mb/sec. That is acceptable. What isn't acceptable is the UI getting jerky. Usually it is just a slightly jerky mouse, but sometimes it is freezing for 5-10 seconds at a time.

My setup is a Retina 5K imac with 4 GHz i7, and 32GB ram. The physical disks are external 6TB USB3 disks. Some info about the zpool is below. I only added the cache and log (partitions of an ssd) to see if they would help resolve my issue. They did not. Has anyone else experienced this sort of UI lag? If I can't find a solution, I may have to abandon ZFS.

Thanks in advance for your help!

Code: Select all
zpool list -v
NAME   SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
zdisk  16.2T   703G  15.6T         -     0%     4%  1.00x  ONLINE  -
  raidz1  16.2T   703G  15.6T         -     0%     4%
    media-4B22B045-90DE-D649-AFAD-2BF80FA3B606      -      -      -         -      -      -
    media-7170E987-EA50-1347-92F2-AC2252E59E9F      -      -      -         -      -      -
    media-FD3133BE-ED42-054F-857F-A93945161DD9      -      -      -         -      -      -
cache      -      -      -      -      -      -
    media-4B22B045-90DE-D649-AFAD-2BF80FA3B606      -      -      -         -      -      -
    media-7170E987-EA50-1347-92F2-AC2252E59E9F      -      -      -         -      -      -
    media-FD3133BE-ED42-054F-857F-A93945161DD9      -      -      -         -      -      -
log      -      -      -         -      -      -
  disk0s6  12.8G      0  12.8G         -     0%     0%
cache      -      -      -         -      -      -
  disk0s4  79.2G   175M  79.1G         -     0%     0%
cache      -      -      -      -      -      -
  disk0s4  79.2G   175M  79.1G         -     0%     0%


(I don't know why cache disk0s4 appears twice)

Code: Select all
$ zfs list
NAME         USED  AVAIL  REFER  MOUNTPOINT
zdisk       10.5T  8.07G  23.5M  /Volumes/zdisk
zdisk/11TB  10.5T  10.0T   468G  -
cmckay
 
Posts: 7
Joined: Wed Jun 08, 2016 11:32 am

Re: UI lag and jerky mouse

Postby lundman » Wed Jun 08, 2016 10:32 pm

We used to experience lag when the allocator used small allocations, so we brought it up to 128K to remove them. But maybe you want to experiment with 256 and see if it better for you. If you compile your own version, it an easy to change to make.

Oh and users seem to report that USB is the worst way to use ZFS. So if you can, try another transport.
User avatar
lundman
 
Posts: 1334
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: UI lag and jerky mouse

Postby Brendon » Fri Jun 10, 2016 3:00 pm

Lundmans suggestion is well worth trying.

I also wonder in f you have overloaded your USB bus

- Brendon
Brendon
 
Posts: 286
Joined: Thu Mar 06, 2014 12:51 pm

Re: UI lag and jerky mouse

Postby haer22 » Sun Jun 12, 2016 1:19 am

I have also experienced lag and jerkiness when the system get under heavy ZFS-load. I tried to put one of my databases on ZFS but the machine was unusable with a mouse that stopped every 5 seconds. The DB server is a quad-i7 with 48GB memory so there really should not be any jerkiness. Disks are connected via Thunderbolt.

My other serve (file-server) is also jerky at 01:00 when my backups start but it is still usable even if it stops responding for 10-20s sometimes. Disks are connected via eSata->Thunderbolt.

I think, but have not determined, that it helped to set the arc_max to 8GB.

It is annoying but not enough for me to take the hassle of setting up a freeBSD box.
haer22
 
Posts: 123
Joined: Sun Mar 23, 2014 2:13 am

Re: UI lag and jerky mouse

Postby haer22 » Sun Jun 12, 2016 1:22 am

Wasn't the major problem with USB that it occasionally renumbered the devices and confused the hell out of ZFS? Hasn't Invariant-disks adressed that problem?

Also, MacOS usb-drivers seems more stable since the days of Yosemite when I became a zfs-convert.

lundman wrote:Oh and users seem to report that USB is the worst way to use ZFS. So if you can, try another transport.
haer22
 
Posts: 123
Joined: Sun Mar 23, 2014 2:13 am

Re: UI lag and jerky mouse

Postby Brendon » Sun Jun 12, 2016 2:45 am

Should definitely increase the allocator quantum in spl from 128k to 256k or 512k as lundman suggests and report back.

To explain it was set at 512k for a long time, some improvements were made that seemed to allow some retuning, but perhaps there is still an issue there.

- Brendon.
Brendon
 
Posts: 286
Joined: Thu Mar 06, 2014 12:51 pm

Re: UI lag and jerky mouse

Postby haer22 » Sun Jun 12, 2016 5:19 am

Is there a "sysctl" parameter for this or is it compile-time?

Brendon wrote:Should definitely increase the allocator quantum in spl from 128k to 256k or 512k as lundman suggests and report back.

To explain it was set at 512k for a long time, some improvements were made that seemed to allow some retuning, but perhaps there is still an issue there.

- Brendon.
haer22
 
Posts: 123
Joined: Sun Mar 23, 2014 2:13 am

Re: UI lag and jerky mouse

Postby Brendon » Sun Jun 12, 2016 1:00 pm

Compile
Brendon
 
Posts: 286
Joined: Thu Mar 06, 2014 12:51 pm

Re: UI lag and jerky mouse

Postby lundman » Sun Jun 12, 2016 5:07 pm

It's embedded with size of certain structs, so it would not be easy to make dynamic.

But if you can compile ZFS yourself, and it is really quite easy if you can disable sip, you need to fiddle with;

Code: Select all
spl/include/sys/vmem.h:
#define KMEM_QUANTUM (PAGESIZE<<5) // (<<5, 128k,


Where you want to change the 5 -> 6 for 256
User avatar
lundman
 
Posts: 1334
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: UI lag and jerky mouse

Postby cmckay » Wed Jun 15, 2016 3:40 pm

This all is a bit over my head.

Step 1 is uninstalling the installer version so that I can switch to source, which isn't going well...

Code: Select all
$ ~/Desktop/uninstall-openzfsonosx.sh
Checking for admin privileges
Please enter your password
Checking for admin privileges
Starting uninstall
Created uninstall log file.../Users/cedar/zfsuninstaller.ewQYL2
No pools should be imported
/usr/sbin/zpool does not exist.
You will need to export your pool(s) and unload zfs.kext manually before uninstalling.


The terminal session above implies that it asked me for my password, but that never happened. I previously exported my pool, but it looks like kexts are still running...

Code: Select all
$ kextstat | grep lundman
  122    1 0xffffff7f80a7b000 0x3f8      0x3f8      net.lundman.kernel.dependencies.25 (12.5.0) 677C6A8F-599C-40AD-BBA1-EFEB6599D32B
  123    1 0xffffff7f80a7c000 0x51000    0x51000    net.lundman.spl (1.5.2) 270A6F0A-C32A-3592-B58E-0905804250A9 <122 7 5 4 3 1>
  148    0 0xffffff7f8407f000 0x244000   0x244000   net.lundman.zfs (1.5.2) FCDA5467-0C14-3143-BF25-EA290F61BBFC <123 16 7 5 4 3 1>
$ sudo kextunload -b net.lundman.zfs
$ sudo kextunload -b net.lundman.spl
(kernel) Can't remove kext net.lundman.spl; services failed to terminate - 0xdc008018.
Failed to unload net.lundman.spl - (libkern/kext) kext is in use or retained (cannot unload).
$ sudo kextunload -b net.lundman.kernel.dependencies.25
(kernel) Can't remove kext net.lundman.kernel.dependencies.25; services failed to terminate - 0xdc008018.
Failed to unload net.lundman.kernel.dependencies.25 - (libkern/kext) kext is in use or retained (cannot unload).


In the meantime I'm trying to compile from source...

Code: Select all
sudo port install automake libtool gawk coreutils
mkdir -p ~/Developer ~/bin
chmod 700 ~/Developer ~/bin
chmod +a "group:everyone deny delete" ~/Developer ~/bin
echo 'export PATH=$HOME/bin:$PATH' >> ~/.bash_profile
source ~/.bash_profile
cd Developer/
git clone https://gist.github.com/7713854.git zfsadm-repo
cp zfsadm-repo/zfsadm ~/bin/
zfsadm
edit spl/include/sys/vmem.h #[change PAGESIZE to 6]
zfsadm #hopefully recompile with new PAGESIZE
cd ~/Developer/spl
sudo make install
cd ~/Developer/zfs
sudo make install
kextstat | grep lundman
  122    1 0xffffff7f80a7b000 0x3f8      0x3f8      net.lundman.kernel.dependencies.25 (12.5.0) 677C6A8F-599C-40AD-BBA1-EFEB6599D32B
  123    1 0xffffff7f80a7c000 0x51000    0x51000    net.lundman.spl (1.5.2) 270A6F0A-C32A-3592-B58E-0905804250A9 <122 7 5 4 3 1>
  149    0 0xffffff7f8407f000 0x244000   0x244000   net.lundman.zfs (1.5.2) FCDA5467-0C14-3143-BF25-EA290F61BBFC <123 16 7 5 4 3 1>


Looks like the exact same kexts are still loaded, not the newly built ones?

Where have I gone wrong?
cmckay
 
Posts: 7
Joined: Wed Jun 08, 2016 11:32 am

Next

Return to Absolute Beginners Section

Who is online

Users browsing this forum: No registered users and 4 guests

cron