# Degraded interactive performance with ZFS under load.



## SageRaven (Jul 21, 2010)

I've googled around and have only seen a little about this issue.

Whenever I beat the tar out of a ZFS file sytem (writing gigabytes at a time, such as imaging hard drives), I get mouse lag, window redraw lag, and skipping sound.  It's an order of magnitude worse (system is pretty much unusable) if the file system in question has compression enabled.

I've got a 4-core 3.4GHz Phenom-II w/ 8GB of DDR3, and 640GB WD SATA "Blue" drives.  While the drives aren't stellar performers, I don't get any such performance lags when beating the tar out of the ancient 160GB PATA disk with UFS I use for my /tmp space.

For previous versions of FreeBSD, I've seen mention of patches related to this.  I was hoping there were official knobs in 8.1-RELEASE that I could use to make the system more responsive under load.

As much as it would pain me to ditch ZFS (it's just so damned useful!), I'm leaning that way because the degradation of performance is very, very irritating.  I certainly hope there are some tuning tweaks I can get my hands on.


----------



## phoenix (Jul 21, 2010)

This is the nature of the beast.

UFS is simple filesystem that just writes data, updates metadata, and that's it.

ZFS is a complex storage management system that compresses data, writes data out in batches, keeps track of transactions, does things atomically, handles RAID in software, calculates checksums, stores checksums, compares checksums, etc, etc, etc.  It's a very CPU/RAM intensive setup.

Of course it's going to slow down other things (like X) running on the same system during writes.  Especially if using SHA256 checksums, gzip compression, and raidz2.

There are things that can be done to minimise this load, but there's no way to eliminate it, and there's no way to make it perform as "lightly" as UFS.

Search around the freebsd-fs, freebsd-current, and freebsd-stable mailing lists for "min_pending", "max_pending", and "txg_timeout" (or txg something).  Those allow you to tune ZFS for your storage setup (disk type, disk speed, controller speed, etc).

Alternatively, separate your GUI desktop from your storage server, so that storage issues don't bog down your mouse.


----------

