# sync;sync not working (ZFS problem?)



## da1 (Apr 14, 2011)

Hi guys,

This thread is related to http://forums.freebsd.org/showthread.php?t=23159 and http://forums.freebsd.org/showthread.php?t=23234.

Last night I started an upgrade of several ports and at one point (while upgrading "celt") the system became really slow (similar to when one has overloaded disks). I checked gstat, vmstat, iostat, top, ps, and all are reporting no load what so ever on the system. The CPU (Intel E6550 @2.3GHz) is @ 0.1% max and I have ~130 active RAM (6GB in ntotal).

Today, I ran "sync", and I didn;t get the prompt back (15 min already), I did CTRL+T and saw (several CTRL+T's here):

```
[root@mainserver ~]# sync
load: 0.00  cmd: sync 37016 [zilog->zl_cv_writer)] 1.20r 0.00u 0.01s 0% 604k
load: 0.00  cmd: sync 37016 [zilog->zl_cv_writer)] 4.99r 0.00u 0.01s 0% 604k
load: 0.00  cmd: sync 37016 [zilog->zl_cv_writer)] 10.20r 0.00u 0.01s 0% 604k
load: 0.00  cmd: sync 37016 [zilog->zl_cv_writer)] 14.38r 0.00u 0.01s 0% 604k
load: 0.00  cmd: sync 37016 [zilog->zl_cv_writer)] 19.34r 0.00u 0.01s 0% 604k
load: 0.00  cmd: sync 37016 [zilog->zl_cv_writer)] 23.13r 0.00u 0.01s 0% 604k
load: 0.00  cmd: sync 37016 [zilog->zl_cv_writer)] 109.42r 0.00u 0.01s 0% 604k
load: 0.00  cmd: sync 37016 [zilog->zl_cv_writer)] 213.29r 0.00u 0.01s 0% 604k
load: 0.05  cmd: sync 37016 [zilog->zl_cv_writer)] 295.74r 0.00u 0.01s 0% 604k
```

"zpool status" reports everything fine. /etc/sysctl.conf contains:

```
kern.maxvnodes=10000
vfs.zfs.txg.write_limit_override=268435456
security.jail.allow_raw_sockets=1
```
/boot/loader.conf:

```
vfs.root.mountfrom="zfs:zroot"
zfs_load="YES"
geom_mirror_load="YES"
linux_load="YES"
sound_load="YES"
snd_hda_load="YES"
nvidia_load="YES"
accf_http_load="YES"
#vboxdrv_load="YES"
#vboxnetflt_load="YES"
loader_logo="beastie"
coretemp_load="YES"
geom_label_load="YES"
atapicam_load="YES"                     # allows ATAPI devices to be accessed through the SCSI subsystem, cam(4)
ahci_load="YES"                         # Allow S-ATA extra features (NCQ,etc)
xhci_load="YES"
if_tap_load="YES"
cuse4bsd_load="YES"                     # webcamd module
pwc_load="YES"
ng_ubt_load="YES"

############# ZFS tunnables
## for AHCI
vfs.zfs.vdev.min_pending=4              #default=4
vfs.zfs.vdev.max_pending=8              #default = 35
## NO AHCI
#vfs.zfs.vdev.min_pending=4             #default=4
#vfs.zfs.vdev.max_pending=8             #default = 35

# Increase vm.kmem_size to allow for ZFS ARC to utilise more memory.
vm.kmem_size="2048M"
vm.kmem_size_max="2048M"
vfs.zfs.arc_max="2048M"

# Disable ZFS prefetching (we will not disable it because we have 6GB of RAM)
# http://southbrain.com/south/2008/04/the-nightmare-comes-slowly-zfs.html
# vfs.zfs.prefetch_disable="0"

# Decrease ZFS txg timeout value from 30 (default) to 5 seconds.  This
# should increase throughput and decrease the "bursty" stalls that
# happen during immense I/O with ZFS.
# http://lists.freebsd.org/pipermail/freebsd-fs/2009-December/007343.html
# http://lists.freebsd.org/pipermail/freebsd-fs/2009-December/007355.html
vfs.zfs.txg.timeout="5"

# Target seconds to sync a txg
vfs.zfs.txg.synctime="1"
```

I had no problems with ZFS for quite some time now ....

Is there some problem with ZFS not being able to write or something ? Can anyone spot any issues here ?


----------

