Skip to contentSkip to conversation

very slow write to AHCI device

DISCUSSION Daniel Pocock 2 participants 6 messages May 7, 2012 – May 8, 2012 libata

lore
Share & tools
lore
#0 lore raw

Hi,

I'm testing a problem with the following combination:
- SB700/SB800 type controller in AHCI mode (in a HP Microserver N36L)
- Seagate Barracuda 1TB 7k2 drive with NCQ

I've got a fresh 256MB partition, formatted ext4, mounted barrier=1,data=ordered, write-cache enabled (hdparm -W 1 /dev/sdb) and shared over NFS.

When the NFS client writes,
- unpacking a source tarball, many small files, iostat reports speeds under 500kBytes/sec
- dd conv=fsync, iostat reports about 50MB/sec

If I set up a USB disk on the same box, with a partition formatted exactly the same way, the iostat reports the write speed (unpacking the same tarball) is over 5MBytes/sec - not so fast, but 10 times faster than the AHCI device.

Is there anything I can do to troubleshoot this issue?

Or should I just stop using this onboard SATA and go to something like an Adaptec 1405?

Regards,

Daniel

#1 lore raw

Hi Daniel,

Quoted 7 lines · Daniel Pocock

Hi,

I'm testing a problem with the following combination:
- SB700/SB800 type controller in AHCI mode (in a HP Microserver N36L)
- Seagate Barracuda 1TB 7k2 drive with NCQ

Is that a disk with 4k hardware sectors (Advanced Format)? Where does you partition start? At sector 63 or 2048? ;-)

Quoted 10 lines

I've got a fresh 256MB partition, formatted ext4, mounted barrier=1,data=ordered, write-cache enabled (hdparm -W 1 /dev/sdb) and shared over NFS.

When the NFS client writes,
- unpacking a source tarball, many small files, iostat reports speeds under 500kBytes/sec
- dd conv=fsync, iostat reports about 50MB/sec

Quoted 4 lines

If I set up a USB disk on the same box, with a partition formatted exactly the same way, the iostat reports the write speed (unpacking the same tarball) is over 5MBytes/sec - not so fast, but 10 times faster than the AHCI device.

So USB is at speed 10 times less, right?

Martin

#2 lore raw
Quoted 5 lines · Martin Mokrejs

Hi Daniel,

Quoted 1 line · Daniel Pocock
Quoted 10 lines
Quoted 6 lines

Hi,

I'm testing a problem with the following combination:
- SB700/SB800 type controller in AHCI mode (in a HP Microserver N36L)
- Seagate Barracuda 1TB 7k2 drive with NCQ

Is that a disk with 4k hardware sectors (Advanced Format)? Where does you partition start? At sector 63 or 2048? ;-)

At 2048:

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x484d5754

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048      499711      248832   83  Linux

Partition 1 does not end on cylinder boundary.
/dev/sdb2 499712 1953523711 976512000 fd Linux raid
autodetect

Quoted 9 lines
Quoted 9 lines

I've got a fresh 256MB partition, formatted ext4, mounted barrier=1,data=ordered, write-cache enabled (hdparm -W 1 /dev/sdb) and shared over NFS.

When the NFS client writes,
- unpacking a source tarball, many small files, iostat reports speeds under 500kBytes/sec
- dd conv=fsync, iostat reports about 50MB/sec

Quoted 8 lines
Quoted 5 lines

If I set up a USB disk on the same box, with a partition formatted exactly the same way, the iostat reports the write speed (unpacking the same tarball) is over 5MBytes/sec - not so fast, but 10 times faster than the AHCI device.

So USB is at speed 10 times less, right?

No - the USB is 10x faster, 5MBytes/sec, the SATA disk is giving me barely 500kBytes/sec for the same write over NFS

Quoted 6 lines

Martin
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 12 lines · Daniel Pocock
Quoted 11 lines · Martin Mokrejs

Hi Daniel,

Quoted 7 lines · Daniel Pocock

Hi,

I'm testing a problem with the following combination:
- SB700/SB800 type controller in AHCI mode (in a HP Microserver N36L)
- Seagate Barracuda 1TB 7k2 drive with NCQ

Quoted 5 lines
Quoted 4 lines

Is that a disk with 4k hardware sectors (Advanced Format)? Where does you partition start? At sector 63 or 2048? ;-)

At 2048:

So you you safe if it would be 4k sector drive.

Quoted 8 lines

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x484d5754

Quoted 5 lines
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048      499711      248832   83  Linux

Partition 1 does not end on cylinder boundary.
/dev/sdb2 499712 1953523711 976512000 fd Linux raid
autodetect

I caught myself:

# lsscsi 
[0:0:0:0]    disk    ATA      ST380815AS       3.AA  /dev/sda 
[1:0:0:0]    disk    ATA      WDC WD2502ABYS-0 02.0  /dev/sdb 
[2:0:0:0]    disk    ATA      WDC WD1000FYPS-0 02.0  /dev/sdc 
[3:0:0:0]    disk    ATA      WDC WD1000FYPS-0 02.0  /dev/sdd 
[4:0:0:0]    disk    ATA      WDC WD1000FYPS-0 02.0  /dev/sde 
[5:0:0:0]    disk    ATA      WDC WD1000FYPS-0 02.0  /dev/sdf 
# fdisk /dev/sdc 

Command (m for help): p

Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe997c4dd

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1              63  1953520064   976760001   fd  Linux raid autodetect

Command (m for help): q

# smartctl -a /dev/sdc 
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-3.3.2-default] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===

Model Family:     Western Digital RE2-GP
Device Model:     WDC WD1000FYPS-01ZKB0
Serial Number:    WD-WCASJ1253793
LU WWN Device Id: 5 0014ee 256812a2d
Firmware Version: 02.01B01
User Capacity:    1,000,204,886,016 bytes [1.00 TB]
Sector Size:      512 bytes logical/physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   8
ATA Standard is:  Exact ATA specification draft version not indicated
Local Time is:    Mon May  7 20:21:35 2012 MEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

[cut]

Do you have same model?

My disk catch up at 3Gbps:

ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata3.00: ATA-8: WDC WD1000FYPS-01ZKB0, 02.01B01, max UDMA/133
ata3.00: 1953525168 sectors, multi 0: LBA48 NCQ (depth 31/32), AA ata3.00: configured for UDMA/133
scsi 2:0:0:0: Direct-Access ATA WDC WD1000FYPS-0 02.0 PQ: 0 ANSI: 5
sd 2:0:0:0: [sdc] 1953525168 512-byte logical blocks: (1.00 TB/931 GiB) sd 2:0:0:0: Attached scsi generic sg2 type 0
sd 2:0:0:0: [sdc] Write Protect is off
sd 2:0:0:0: [sdc] Mode Sense: 00 3a 00 00
sd 2:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
sdc: sdc1
sd 2:0:0:0: [sdc] Attached SCSI disk

Martin

#4 lore raw
Quoted 58 lines
Quoted 8 lines

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x484d5754

Quoted 6 lines
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048      499711      248832   83  Linux

Partition 1 does not end on cylinder boundary.
/dev/sdb2 499712 1953523711 976512000 fd Linux raid
autodetect

I caught myself:

# lsscsi 
[0:0:0:0]    disk    ATA      ST380815AS       3.AA  /dev/sda 
[1:0:0:0]    disk    ATA      WDC WD2502ABYS-0 02.0  /dev/sdb 
[2:0:0:0]    disk    ATA      WDC WD1000FYPS-0 02.0  /dev/sdc 
[3:0:0:0]    disk    ATA      WDC WD1000FYPS-0 02.0  /dev/sdd 
[4:0:0:0]    disk    ATA      WDC WD1000FYPS-0 02.0  /dev/sde 
[5:0:0:0]    disk    ATA      WDC WD1000FYPS-0 02.0  /dev/sdf 
# fdisk /dev/sdc 

Command (m for help): p

Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe997c4dd

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1              63  1953520064   976760001   fd  Linux raid autodetect

Command (m for help): q

# smartctl -a /dev/sdc 
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-3.3.2-default] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===

Model Family:     Western Digital RE2-GP
Device Model:     WDC WD1000FYPS-01ZKB0
Serial Number:    WD-WCASJ1253793
LU WWN Device Id: 5 0014ee 256812a2d
Firmware Version: 02.01B01
User Capacity:    1,000,204,886,016 bytes [1.00 TB]
Sector Size:      512 bytes logical/physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   8
ATA Standard is:  Exact ATA specification draft version not indicated
Local Time is:    Mon May  7 20:21:35 2012 MEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
Quoted 5 lines

[cut]

Do you have same model?

Not quite:

# smartctl -a /dev/sda
smartctl 5.40 2010-07-12 r3124 [x86_64-unknown-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===

Model Family:     Seagate Barracuda 7200.12 family
Device Model:     ST31000528AS
Serial Number:    6VP0KWSF
Firmware Version: CC49
User Capacity:    1,000,204,886,016 bytes
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   8
ATA Standard is:  ATA-8-ACS revision 4
Local Time is:    Tue May  8 01:26:06 2012 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
Quoted 16 lines

My disk catch up at 3Gbps:

ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata3.00: ATA-8: WDC WD1000FYPS-01ZKB0, 02.01B01, max UDMA/133
ata3.00: 1953525168 sectors, multi 0: LBA48 NCQ (depth 31/32), AA ata3.00: configured for UDMA/133
scsi 2:0:0:0: Direct-Access ATA WDC WD1000FYPS-0 02.0 PQ: 0 ANSI: 5
sd 2:0:0:0: [sdc] 1953525168 512-byte logical blocks: (1.00 TB/931 GiB) sd 2:0:0:0: Attached scsi generic sg2 type 0
sd 2:0:0:0: [sdc] Write Protect is off
sd 2:0:0:0: [sdc] Mode Sense: 00 3a 00 00
sd 2:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
sdc: sdc1
sd 2:0:0:0: [sdc] Attached SCSI disk

One of mine died as soon as I upgraded to the CC49 firmware today:

[ 2905.173593] sd 0:0:0:0: [sda] Unhandled error code
[ 2905.173599] sd 0:0:0:0: [sda]  Result: hostbyte=DID_BAD_TARGET
driverbyte=DRIVER_OK
[ 2905.173608] sd 0:0:0:0: [sda] CDB: Write(10): 2a 00 18 f7 aa c8 00 00
10 00
[ 2905.173628] end_request: I/O error, dev sda, sector 418884296
[ 2905.180214] sd 0:0:0:0: [sda] Unhandled error code
[ 2905.180220] sd 0:0:0:0: [sda]  Result: hostbyte=DID_BAD_TARGET
driverbyte=DRIVER_OK
[ 2905.180234] sd 0:0:0:0: [sda] CDB: Write(10): 2a 00 18 f7 aa b8 00 00
08 00
[ 2905.180286] end_request: I/O error, dev sda, sector 418884280
[ 2905.180496] md/raid1:md2: Disk failure on sda2, disabling device.
[ 2905.180501] md/raid1:md2: Operation continuing on 1 devices.
[ 2905.199738] sd 0:0:0:0: [sda] Unhandled error code

Lucky I'm using md

I thought maybe the firmware had just exposed a pre-existing problem and that maybe the bad drive had already been making my AHCI controller slow down - but removing the drive completely hasn't made operations any faster on the remaining drive.

I'm now looking to replace them with something like the Seagate Constellation or another slightly more robust enterprise drive, maybe even SAS

#5 lore raw
Quoted 40 lines · Daniel Pocock

Not quite:

# smartctl -a /dev/sda
smartctl 5.40 2010-07-12 r3124 [x86_64-unknown-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===

Model Family:     Seagate Barracuda 7200.12 family
Device Model:     ST31000528AS
Serial Number:    6VP0KWSF
Firmware Version: CC49
User Capacity:    1,000,204,886,016 bytes
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   8
ATA Standard is:  ATA-8-ACS revision 4
Local Time is:    Tue May  8 01:26:06 2012 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
Quoted 16 lines

My disk catch up at 3Gbps:

ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata3.00: ATA-8: WDC WD1000FYPS-01ZKB0, 02.01B01, max UDMA/133
ata3.00: 1953525168 sectors, multi 0: LBA48 NCQ (depth 31/32), AA ata3.00: configured for UDMA/133
scsi 2:0:0:0: Direct-Access ATA WDC WD1000FYPS-0 02.0 PQ: 0 ANSI: 5
sd 2:0:0:0: [sdc] 1953525168 512-byte logical blocks: (1.00 TB/931 GiB) sd 2:0:0:0: Attached scsi generic sg2 type 0
sd 2:0:0:0: [sdc] Write Protect is off
sd 2:0:0:0: [sdc] Mode Sense: 00 3a 00 00
sd 2:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
sdc: sdc1
sd 2:0:0:0: [sdc] Attached SCSI disk

One of mine died as soon as I upgraded to the CC49 firmware today:

Quoted 17 lines
[ 2905.173593] sd 0:0:0:0: [sda] Unhandled error code
[ 2905.173599] sd 0:0:0:0: [sda]  Result: hostbyte=DID_BAD_TARGET
driverbyte=DRIVER_OK
[ 2905.173608] sd 0:0:0:0: [sda] CDB: Write(10): 2a 00 18 f7 aa c8 00 00
10 00
[ 2905.173628] end_request: I/O error, dev sda, sector 418884296
[ 2905.180214] sd 0:0:0:0: [sda] Unhandled error code
[ 2905.180220] sd 0:0:0:0: [sda]  Result: hostbyte=DID_BAD_TARGET
driverbyte=DRIVER_OK
[ 2905.180234] sd 0:0:0:0: [sda] CDB: Write(10): 2a 00 18 f7 aa b8 00 00
08 00
[ 2905.180286] end_request: I/O error, dev sda, sector 418884280
[ 2905.180496] md/raid1:md2: Disk failure on sda2, disabling device.
[ 2905.180501] md/raid1:md2: Operation continuing on 1 devices.
[ 2905.199738] sd 0:0:0:0: [sda] Unhandled error code

I use CC4C in my 3TB Seagates (ST3000DM001 disk, 4k sectors). Do you wnat to downgrade? ;-)

Martin