# ZIL-related write stall on Seagate NAS drive



## aupanner (Nov 6, 2013)

I have a simple 2TB mirror using a WD Red 2TB and a Seagate NAS 2TB.  When copying files to ZFS I observe the following behavior:


decent overall throughput: 33 MB/s with `sftp`, 65 MB/s with Samba
writes of 80,000 kBps
periodic stalls in throughput to 0
one drive's writes drop to zero and one drive to 10,000 kBps
during the stall ms/w jumps 10x and busy goes to 100+%
this continues for ~7 seconds and then the copy recovers
if I detach the WD from the pool, the stall still occurs
if I detach the ST from the pool, the stall does not occur
if I swap the order of the drives, the stall still occurs
if ZIL is disabled (`zfs set sync=disabled`), the stalls do not occur
The problematic disk is the Seagate ST2000VN000.  It seems that ZIL access sometimes causes the ms/w to spike, which causes the disk to fall behind, which stalls the entire write until the disk catches up.  The duration of the stall depends on the backlog of data, which depends on the initial write speed.


Does anyone else have 1+ of the Seagate NAS drives to confirm/deny the same behavior on their system?  Is this sort of behavior "expected" with some drives?  Any other suggestions or things to try?



Drives:

```
atapci1: <nVidia nForce CK804 SATA300 controller> port 0x9e0-0x9e7,0xbe0-0xbe3,0x960-0x967,0xb60-0xb63,0xd400-0xd40f mem 0xd4001000-0xd4001fff irq 20 at device 8.0 on pci0
ata2: <ATA channel> at channel 0 on atapci1
ata3: <ATA channel> at channel 1 on atapci1
ada1 at ata2 bus 0 scbus2 target 0 lun 0
ada1: <ST2000VN000-1H3164 SC42> ATA-9 SATA 3.x device
ada1: 300.000MB/s transfers (SATA 2.x, UDMA5, PIO 8192bytes)
ada1: 1907729MB (3907029168 512 byte sectors: 16H 63S/T 16383C)
ada1: Previously was known as ad4
ada2 at ata3 bus 0 scbus3 target 0 lun 0
ada2: <WDC WD20EFRX-68AX9N0 80.00A80> ATA-9 SATA 3.x device
ada2: 300.000MB/s transfers (SATA 2.x, UDMA5, PIO 8192bytes)
ada2: 1907729MB (3907029168 512 byte sectors: 16H 63S/T 16383C)
ada2: quirks=0x1<4K>
ada2: Previously was known as ad6
```


Smart (`smartctl -a /dev/ada1`) output:


```
smartctl 6.2 2013-07-26 r3841 [FreeBSD 9.2-RELEASE amd64] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model:     ST2000VN000-1H3164
Serial Number:    W1H2741N
LU WWN Device Id: 5 000c50 06a67ff84
Firmware Version: SC42
User Capacity:    2,000,398,934,016 bytes [2.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    5900 rpm
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ACS-2, ACS-3 T13/2161-D revision 3b
SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Wed Nov  6 13:13:07 2013 PST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00) Offline data collection activity
                                        was never started.
                                        Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0) The previous self-test routine completed
                                        without error or no self-test has ever
                                        been run.
Total time to complete Offline
data collection:                (  107) seconds.
Offline data collection
capabilities:                    (0x73) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        No Offline surface scan supported.
                                        Self-test supported.
                                        Conveyance Self-test supported.
                                        Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                                        power-saving mode.
                                        Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                                        General Purpose Logging supported.
Short self-test routine
recommended polling time:        (   1) minutes.
Extended self-test routine
recommended polling time:        ( 271) minutes.
Conveyance self-test routine
recommended polling time:        (   2) minutes.
SCT capabilities:              (0x10bd) SCT Status supported.
                                        SCT Error Recovery Control supported.
                                        SCT Feature Control supported.
                                        SCT Data Table supported.

SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   119   100   006    Pre-fail  Always       -       220772792
  3 Spin_Up_Time            0x0003   095   095   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       12
  5 Reallocated_Sector_Ct   0x0033   100   100   010    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000f   063   060   030    Pre-fail  Always       -       2459484
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       635
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       12
184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
188 Command_Timeout         0x0032   100   100   000    Old_age   Always       -       0
189 High_Fly_Writes         0x003a   007   007   000    Old_age   Always       -       93
190 Airflow_Temperature_Cel 0x0022   071   060   045    Old_age   Always       -       29 (Min/Max 28/37)
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       0
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       10
193 Load_Cycle_Count        0x0032   100   100   000    Old_age   Always       -       12
194 Temperature_Celsius     0x0022   029   040   000    Old_age   Always       -       29 (0 19 0 0 0)
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed without error       00%        97         -
# 2  Short offline       Completed without error       00%        73         -
# 3  Short offline       Completed without error       00%        49         -
# 4  Extended offline    Completed without error       00%        30         -
# 5  Short offline       Completed without error       00%        25         -
# 6  Extended offline    Completed without error       00%         4         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
```


----------

