# sata drives and raid array have got much slower

## bendy

Hi,

I have some raid0 striped arrays, including my / and /home partitions, set up on WD Raptor 10k sata drives.  They used to give very fast performance, but have slowed down dramatically.

```
nickdesk nick # hdparm -tT /dev/md1

/dev/md1:

 Timing cached reads:   2328 MB in  2.00 seconds = 1163.67 MB/sec

 Timing buffered disk reads:  188 MB in  3.03 seconds =  62.06 MB/sec
```

The Timed buffered disk reads throughput is crap.  I used to get over 100 MB/sec, and I have another box with a single non-raid sata drive that gives mid-60s.

I have tried running hdparm when booted into a console only with X and all non-essential services turned off, and it has no significant effect on the results.

The sata drives are attached to a via chipset.  This is of course software raid, and the file system is reiserfs.  I am running a 64 bit AMD64 system.  My boot partition is on an ide drive (non-raid).

Before looking at the hdparm output, I was wondering if the slow-down was due to fragmentation of the reiserfs file system, as I nearly completely filled the partitions at one point due to a freak video transcoding accident.  Can file system fragmentation affect performance as measured by hdparm?

Selected extracts from my kernel config are as follows:

```
#

CONFIG_X86_64=y

CONFIG_64BIT=y

CONFIG_X86=y

#

# IO Schedulers

#

CONFIG_IOSCHED_NOOP=y

# CONFIG_IOSCHED_AS is not set

# CONFIG_IOSCHED_DEADLINE is not set

CONFIG_IOSCHED_CFQ=y

# CONFIG_DEFAULT_AS is not set

# CONFIG_DEFAULT_DEADLINE is not set

CONFIG_DEFAULT_CFQ=y

# CONFIG_DEFAULT_NOOP is not set

CONFIG_DEFAULT_IOSCHED="cfq"

#

# Processor type and features

#

CONFIG_X86_PC=y

# CONFIG_X86_VSMP is not set

CONFIG_MK8=y

# CONFIG_MPSC is not set

# CONFIG_GENERIC_CPU is not set

CONFIG_X86_L1_CACHE_BYTES=64

CONFIG_X86_L1_CACHE_SHIFT=6

CONFIG_X86_INTERNODE_CACHE_BYTES=64

CONFIG_X86_TSC=y

CONFIG_X86_GOOD_APIC=y

# CONFIG_MICROCODE is not set

CONFIG_X86_MSR=y

CONFIG_X86_CPUID=y

CONFIG_X86_IO_APIC=y

CONFIG_X86_LOCAL_APIC=y

CONFIG_MTRR=y

# CONFIG_SMP is not set

# CONFIG_PREEMPT_NONE is not set

CONFIG_PREEMPT_VOLUNTARY=y

# CONFIG_PREEMPT is not set

CONFIG_ARCH_SPARSEMEM_ENABLE=y

CONFIG_ARCH_FLATMEM_ENABLE=y

CONFIG_SELECT_MEMORY_MODEL=y

CONFIG_FLATMEM_MANUAL=y

# CONFIG_DISCONTIGMEM_MANUAL is not set

# CONFIG_SPARSEMEM_MANUAL is not set

CONFIG_FLATMEM=y

CONFIG_FLAT_NODE_MEM_MAP=y

# CONFIG_SPARSEMEM_STATIC is not set

CONFIG_SPLIT_PTLOCK_CPUS=4

CONFIG_RESOURCES_64BIT=y

CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y

CONFIG_HPET_TIMER=y

CONFIG_HPET_EMULATE_RTC=y

CONFIG_IOMMU=y

# CONFIG_CALGARY_IOMMU is not set

CONFIG_SWIOTLB=y

CONFIG_X86_MCE=y

# CONFIG_X86_MCE_INTEL is not set

CONFIG_X86_MCE_AMD=y

# CONFIG_KEXEC is not set

# CONFIG_CRASH_DUMP is not set

CONFIG_PHYSICAL_START=0x200000

CONFIG_SECCOMP=y

# CONFIG_HZ_100 is not set

# CONFIG_HZ_250 is not set

CONFIG_HZ_1000=y

CONFIG_HZ=1000

# CONFIG_REORDER is not set

CONFIG_K8_NB=y

CONFIG_GENERIC_HARDIRQS=y

CONFIG_GENERIC_IRQ_PROBE=y

CONFIG_ISA_DMA_API=y

#

# Device Drivers

#

#

# ATA/ATAPI/MFM/RLL support

#

CONFIG_IDE=y

CONFIG_BLK_DEV_IDE=y

#

# Please see Documentation/ide.txt for help/info on IDE drives

#

# CONFIG_BLK_DEV_IDE_SATA is not set

# CONFIG_BLK_DEV_HD_IDE is not set

CONFIG_BLK_DEV_IDEDISK=y

CONFIG_IDEDISK_MULTI_MODE=y

CONFIG_BLK_DEV_IDECD=y

# CONFIG_BLK_DEV_IDETAPE is not set

# CONFIG_BLK_DEV_IDEFLOPPY is not set

# CONFIG_BLK_DEV_IDESCSI is not set

# CONFIG_IDE_TASK_IOCTL is not set

#

# IDE chipset support/bugfixes

#

# CONFIG_IDE_GENERIC is not set

# CONFIG_BLK_DEV_CMD640 is not set

CONFIG_BLK_DEV_IDEPCI=y

CONFIG_BLK_DEV_IDEDMA_PCI=y

CONFIG_IDEDMA_PCI_AUTO=y

CONFIG_BLK_DEV_VIA82CXXX=y

CONFIG_BLK_DEV_IDEDMA=y

CONFIG_IDEDMA_AUTO=y

#

# SCSI device support

#

# CONFIG_RAID_ATTRS is not set

CONFIG_SCSI=y

# CONFIG_SCSI_PROC_FS is not set

#

# SCSI support type (disk, tape, CD-ROM)

#

CONFIG_BLK_DEV_SD=y

CONFIG_BLK_DEV_SR=y

CONFIG_CHR_DEV_SG=y

#

# SCSI low-level drivers

#

CONFIG_SCSI_SATA=y

CONFIG_SCSI_SATA_VIA=y

#

# Multi-device support (RAID and LVM)

#

CONFIG_MD=y

CONFIG_BLK_DEV_MD=y

# CONFIG_MD_LINEAR is not set

CONFIG_MD_RAID0=y

# CONFIG_MD_RAID1 is not set

# CONFIG_MD_RAID10 is not set

# CONFIG_MD_RAID456 is not set

# CONFIG_MD_MULTIPATH is not set

# CONFIG_MD_FAULTY is not set

# CONFIG_BLK_DEV_DM is not set

#

# DMA Engine support

#

CONFIG_DMA_ENGINE=y

#

# DMA Clients

#

CONFIG_NET_DMA=y

#

# DMA Devices

#

# CONFIG_INTEL_IOATDMA is not set

#

# Firmware Drivers

#

# CONFIG_EDD is not set

# CONFIG_DELL_RBU is not set

# CONFIG_DCDBAS is not set

#

# File systems

#

CONFIG_EXT2_FS=y

CONFIG_REISERFS_FS=y

# CONFIG_REISERFS_CHECK is not set

# CONFIG_REISERFS_PROC_INFO is not set

# CONFIG_REISERFS_FS_XATTR is not set

# CONFIG_JFS_FS is not set

# CONFIG_FS_POSIX_ACL is not set

CONFIG_XFS_FS=y

# CONFIG_XFS_QUOTA is not set

# CONFIG_XFS_SECURITY is not set

# CONFIG_XFS_POSIX_ACL is not set

# CONFIG_XFS_RT is not set

# CONFIG_OCFS2_FS is not set

# CONFIG_MINIX_FS is not set

# CONFIG_ROMFS_FS is not set

CONFIG_INOTIFY=y

CONFIG_INOTIFY_USER=y

# CONFIG_QUOTA is not set

CONFIG_DNOTIFY=y
```

and emerge --info gives:

```
Portage 2.1.1-r2 (default-linux/amd64/2006.1/desktop, gcc-4.1.1, glibc-2.4-r4, 2.6.18-gentoo-r5 x86_64)

=================================================================

System uname: 2.6.18-gentoo-r5 x86_64 AMD Athlon(tm) 64 Processor 3400+

Gentoo Base System version 1.12.6

Last Sync: Sat, 23 Dec 2006 03:50:01 +0000

distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]

app-admin/eselect-compiler: [Not Present]

dev-java/java-config: 1.3.7, 2.0.30

dev-lang/python:     2.3.5-r2, 2.4.3-r4

dev-python/pycrypto: 2.0.1-r5

dev-util/ccache:     [Not Present]

dev-util/confcache:  [Not Present]

sys-apps/sandbox:    1.2.17

sys-devel/autoconf:  2.13, 2.60

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2

sys-devel/binutils:  2.16.1-r3

sys-devel/gcc-config: 1.3.14

sys-devel/libtool:   1.5.22

virtual/os-headers:  2.6.11-r2

ACCEPT_KEYWORDS="amd64"

AUTOCLEAN="yes"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-march=athlon64 -O2 -pipe -fomit-frame-pointer -ftracer -fweb -frename-registers -funit-at-a-time"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/"

CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/splash /etc/terminfo"

CXXFLAGS="-march=athlon64 -O2 -pipe -fomit-frame-pointer -ftracer -fweb -frename-registers -funit-at-a-time"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"

GENTOO_MIRRORS="ftp://mirrors.blueyonder.co.uk/mirrors/gentoo http://gentoo.oregonstate.edu"

LDFLAGS="-Wl,-O1"

LINGUAS="en_GB"

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/local/portage"

SYNC="rsync://192.168.1.104/gentoo-portage"

USE="amd64 3dnowex X a52 aac aalib acpi alsa alsa_pcm_plugins_adpcm alsa_pcm_plugins_alaw alsa_pcm_plugins_asym alsa_pcm_plugins_copy alsa_pcm_plugins_dmix alsa_pcm_plugins_dshare alsa_pcm_plugins_dsnoop alsa_pcm_plugins_empty alsa_pcm_plugins_extplug alsa_pcm_plugins_file alsa_pcm_plugins_hooks alsa_pcm_plugins_iec958 alsa_pcm_plugins_ioplug alsa_pcm_plugins_ladspa alsa_pcm_plugins_lfloat alsa_pcm_plugins_linear alsa_pcm_plugins_meter alsa_pcm_plugins_mulaw alsa_pcm_plugins_multi alsa_pcm_plugins_null alsa_pcm_plugins_plug alsa_pcm_plugins_rate alsa_pcm_plugins_route alsa_pcm_plugins_share alsa_pcm_plugins_shm alsa_pcm_plugins_softvol arts artswrappersuid avi berkdb bitmap-fonts bzip2 bzlib cairo cddb cdparanoia cdr cpudetection cups curl dbus directfb divx4linux dlloader doc dri dvd dvdr dvdread elibc_glibc emul-linux encode fam fbcon ffmpeg freetype gdbm gif gimp glibc-omitfp glitz gphoto2 gtk2 hal imagemagick imlib input_devices_keyboard input_devices_mouse input_devices_ps2mouse ithreads java javascript joystick jpeg kde kdehiddenvisibility kernel_linux libwww linguas_en_GB lm_sensors logitech-mouse logrotate mad mjpeg motif mozilla moznocompose moznoirc moznomail mozsvg mp3 mpeg mplayer musicbrainz ncurses nls nodrm nptl nptlonly nsplugin nvidia ogg oggvorbis opengl pam pcre pda pdf pdflib perl pic png ppds python qt3 quicktime readline rtc scanner sdl sensord slang softmmu spell ssl svg theora tidy tiff transcode truetype truetype-fonts type1 type1-fonts usb userland_GNU userlocales vcd vcdimager video_cards_nv video_cards_nvidia video_cards_vesa visualization vorbis xcomposite xine xml xml2 xorg xv xvid xvmc zlib"

Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_RSYNC_EXTRA_OPTS
```

Also, in case it matters:

```
nick@nickdesk ~ $ dmesg | grep md

ata1: SATA max UDMA/133 cmd 0xB400 ctl 0xB802 bmdma 0xC400 irq 17

ata2: SATA max UDMA/133 cmd 0xBC00 ctl 0xC002 bmdma 0xC408 irq 17

md: raid0 personality registered for level 0

md: md driver 0.90.3 MAX_MD_DEVS=256, MD_SB_DISKS=27

md: bitmap version 4.39

md: Autodetecting RAID arrays.

md: autorun ...

md: considering sdb2 ...

md:  adding sdb2 ...

md: sdb1 has different UUID to sdb2

md:  adding sda2 ...

md: sda1 has different UUID to sdb2

md: created md1

md: bind<sda2>

md: bind<sdb2>

md: running: <sdb2><sda2>

md1: setting max_sectors to 64, segment boundary to 16383

raid0 : md_size is 17671296 blocks.

md: considering sdb1 ...

md:  adding sdb1 ...

md:  adding sda1 ...

md: created md0

md: bind<sda1>

md: bind<sdb1>

md: running: <sdb1><sda1>

md0: setting max_sectors to 64, segment boundary to 16383

raid0 : md_size is 17671296 blocks.

md: ... autorun DONE.

ReiserFS: md0: found reiserfs format "3.6" with standard journal

ReiserFS: md0: using ordered data mode

ReiserFS: md0: journal params: device md0, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30

ReiserFS: md0: checking transaction log (md0)

ReiserFS: md0: Using r5 hash to sort names

md: raidstart(pid 2384) used deprecated START_ARRAY ioctl. This will not be supported beyond July 2006

md: autorun ...

md: considering sdb3 ...

md:  adding sdb3 ...

md:  adding sda3 ...

md: created md2

md: bind<sda3>

md: bind<sdb3>

md: running: <sdb3><sda3>

md2: setting max_sectors to 64, segment boundary to 16383

raid0 : md_size is 36949248 blocks.

md: ... autorun DONE.

ReiserFS: md1: found reiserfs format "3.6" with standard journal

ReiserFS: md1: using ordered data mode

ReiserFS: md1: journal params: device md1, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30

ReiserFS: md1: checking transaction log (md1)

ReiserFS: md1: Using r5 hash to sort names

ReiserFS: md2: found reiserfs format "3.6" with standard journal

ReiserFS: md2: using ordered data mode

ReiserFS: md2: journal params: device md2, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30

ReiserFS: md2: checking transaction log (md2)

ReiserFS: md2: Using r5 hash to sort names

nick@nickdesk ~ $ dmesg | grep ata

Memory: 510104k/524224k available (2980k kernel code, 13356k reserved, 1252k data, 212k init)

libata version 2.00 loaded.

sata_via 0000:00:0f.0: version 2.0

sata_via 0000:00:0f.0: routed to hard irq line 1

ata1: SATA max UDMA/133 cmd 0xB400 ctl 0xB802 bmdma 0xC400 irq 17

ata2: SATA max UDMA/133 cmd 0xBC00 ctl 0xC002 bmdma 0xC408 irq 17

scsi0 : sata_via

ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)

ata1.00: ATA-6, max UDMA/133, 72303840 sectors: LBA48

ata1.00: ata1: dev 0 multi count 16

ata1.00: applying bridge limits

ata1.00: configured for UDMA/100

scsi1 : sata_via

ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)

ata2.00: ATA-6, max UDMA/133, 72303840 sectors: LBA48

ata2.00: ata2: dev 0 multi count 16

ata2.00: applying bridge limits

ata2.00: configured for UDMA/100

ReiserFS: md0: using ordered data mode

ReiserFS: md1: using ordered data mode

ReiserFS: md2: using ordered data mode
```

Apologies for the long post, but half my hard drive performance has gone, and I want to know why.....Last edited by bendy on Wed Jan 03, 2007 12:40 pm; edited 1 time in total

----------

## NeddySeagoon

bendy,

As you are using kernel raid, the raid part of your fake raid controller is not used.

hdparm is not sensitive to fragmentaion as it reads a stream of logical blocks from the drive, or parition (or file even) that you give it. Expect to get lower times for partitions near the spindle.

It sounds like you have had some dynamic sector sparing going on, so logical blocks are no longer physically sequential on the disk. Test the underlying partitions with hdparm /dev/sd..  rather than the logical raid device.

Are both slow or only one ?

Depending on your kernel (and therfore libsata version) you may be able to use smartmontools to read the drives SMART data.

----------

## bendy

Thanks for the quick response Neddy.

```
nickdesk nick # hdparm -tT /dev/sda

/dev/sda:

 Timing cached reads:   2628 MB in  2.00 seconds = 1313.52 MB/sec

 Timing buffered disk reads:  140 MB in  3.01 seconds =  46.52 MB/sec

nickdesk nick # hdparm -tT /dev/sdb

/dev/sdb:

 Timing cached reads:   2596 MB in  2.00 seconds = 1297.05 MB/sec

 Timing buffered disk reads:  142 MB in  3.00 seconds =  47.29 MB/sec

nickdesk nick # hdparm -tT /dev/sda1

/dev/sda1:

 Timing cached reads:   2616 MB in  2.00 seconds = 1306.84 MB/sec

 Timing buffered disk reads:  134 MB in  3.00 seconds =  44.63 MB/sec

nickdesk nick # hdparm -tT /dev/sdb1

/dev/sdb1:

 Timing cached reads:   2552 MB in  2.00 seconds = 1276.06 MB/sec

 Timing buffered disk reads:  134 MB in  3.03 seconds =  44.25 MB/sec

nickdesk nick # hdparm -tT /dev/sda2

/dev/sda2:

 Timing cached reads:   2444 MB in  2.00 seconds = 1221.54 MB/sec

 Timing buffered disk reads:  134 MB in  3.04 seconds =  44.13 MB/sec

nickdesk nick # hdparm -tT /dev/sdb2

/dev/sdb2:

 Timing cached reads:   2444 MB in  2.00 seconds = 1222.29 MB/sec

 Timing buffered disk reads:  134 MB in  3.02 seconds =  44.30 MB/sec
```

So both drives seem equally slow.  Hopefully that means that one of them isn't about to die.....

smartctl output doesn't show anything that looks bad to me, but I'm not an expert:

```
nickdesk nick # smartctl -d ata -H /dev/sda

smartctl version 5.36 [x86_64-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen

Home page is http://smartmontools.sourceforge.net/

=== START OF READ SMART DATA SECTION ===

SMART overall-health self-assessment test result: PASSED

nickdesk nick # smartctl -d ata -H /dev/sdb

smartctl version 5.36 [x86_64-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen

Home page is http://smartmontools.sourceforge.net/

=== START OF READ SMART DATA SECTION ===

SMART overall-health self-assessment test result: PASSED

nickdesk nick # smartctl -d ata -a /dev/sda

smartctl version 5.36 [x86_64-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen

Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===

Model Family:     Western Digital Raptor family

Device Model:     WDC WD360GD-00FNA0

Serial Number:    WD-WMAH91449840

Firmware Version: 35.06K35

User Capacity:    37,019,566,080 bytes

Device is:        In smartctl database [for details use: -P show]

ATA Version is:   6

ATA Standard is:  Exact ATA specification draft version not indicated

Local Time is:    Tue Jan  2 20:49:41 2007 GMT

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:  (0x84) Offline data collection activity

                                        was suspended by an interrupting command from host.

                                        Auto Offline Data Collection: Enabled.

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:                 (1575) seconds.

Offline data collection

capabilities:                    (0x7b) SMART execute Offline immediate.

                                        Auto Offline data collection on/off support.

                                        Suspend Offline collection upon new

                                        command.

                                        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.

                                        No General Purpose Logging support.

Short self-test routine

recommended polling time:        (   2) minutes.

Extended self-test routine

recommended polling time:        (  28) minutes.

Conveyance self-test routine

recommended polling time:        (   5) minutes.

SMART Attributes Data Structure revision number: 16

Vendor Specific SMART Attributes with Thresholds:

ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE

  1 Raw_Read_Error_Rate     0x000b   200   200   051    Pre-fail  Always       -       0

  3 Spin_Up_Time            0x0007   085   079   021    Pre-fail  Always       -       2258

  4 Start_Stop_Count        0x0032   099   099   040    Old_age   Always       -       1054

  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0

  7 Seek_Error_Rate         0x000b   100   253   051    Pre-fail  Always       -       0

  9 Power_On_Hours          0x0032   098   098   000    Old_age   Always       -       1912

 10 Spin_Retry_Count        0x0013   100   100   051    Pre-fail  Always       -       0

 11 Calibration_Retry_Count 0x0013   100   100   051    Pre-fail  Always       -       0

 12 Power_Cycle_Count       0x0032   099   099   000    Old_age   Always       -       1054

194 Temperature_Celsius     0x0022   115   253   000    Old_age   Always       -       28

196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0

197 Current_Pending_Sector  0x0012   200   200   000    Old_age   Always       -       0

198 Offline_Uncorrectable   0x0012   200   200   000    Old_age   Always       -       0

199 UDMA_CRC_Error_Count    0x000a   200   253   000    Old_age   Always       -       0

200 Multi_Zone_Error_Rate   0x0009   200   125   051    Pre-fail  Offline      -       0

SMART Error Log Version: 1

No Errors Logged

SMART Self-test log structure revision number 1

No self-tests have been logged.  [To run self-tests, use: smartctl -t]

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.

nickdesk nick # smartctl -d ata -a /dev/sdb

smartctl version 5.36 [x86_64-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen

Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===

Model Family:     Western Digital Raptor family

Device Model:     WDC WD360GD-00FNA0

Serial Number:    WD-WMAH91434378

Firmware Version: 35.06K35

User Capacity:    37,019,566,080 bytes

Device is:        In smartctl database [for details use: -P show]

ATA Version is:   6

ATA Standard is:  Exact ATA specification draft version not indicated

Local Time is:    Tue Jan  2 20:49:51 2007 GMT

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:  (0x84) Offline data collection activity

                                        was suspended by an interrupting command from host.

                                        Auto Offline Data Collection: Enabled.

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:                 (1578) seconds.

Offline data collection

capabilities:                    (0x7b) SMART execute Offline immediate.

                                        Auto Offline data collection on/off support.

                                        Suspend Offline collection upon new

                                        command.

                                        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.

                                        No General Purpose Logging support.

Short self-test routine

recommended polling time:        (   2) minutes.

Extended self-test routine

recommended polling time:        (  28) minutes.

Conveyance self-test routine

recommended polling time:        (   5) minutes.

SMART Attributes Data Structure revision number: 16

Vendor Specific SMART Attributes with Thresholds:

ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE

  1 Raw_Read_Error_Rate     0x000b   200   200   051    Pre-fail  Always       -       0

  3 Spin_Up_Time            0x0007   086   082   021    Pre-fail  Always       -       2200

  4 Start_Stop_Count        0x0032   099   099   040    Old_age   Always       -       1054

  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0

  7 Seek_Error_Rate         0x000b   100   253   051    Pre-fail  Always       -       0

  9 Power_On_Hours          0x0032   098   098   000    Old_age   Always       -       1910

 10 Spin_Retry_Count        0x0013   100   100   051    Pre-fail  Always       -       0

 11 Calibration_Retry_Count 0x0013   100   100   051    Pre-fail  Always       -       0

 12 Power_Cycle_Count       0x0032   099   099   000    Old_age   Always       -       1054

194 Temperature_Celsius     0x0022   113   253   000    Old_age   Always       -       30

196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0

197 Current_Pending_Sector  0x0012   200   200   000    Old_age   Always       -       0

198 Offline_Uncorrectable   0x0012   200   200   000    Old_age   Always       -       0

199 UDMA_CRC_Error_Count    0x000a   200   253   000    Old_age   Always       -       0

200 Multi_Zone_Error_Rate   0x0009   200   125   051    Pre-fail  Offline      -       0

SMART Error Log Version: 1

No Errors Logged

SMART Self-test log structure revision number 1

No self-tests have been logged.  [To run self-tests, use: smartctl -t]

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.
```

In fact nothing appears to be wrong, it's just slow.....

----------

## NeddySeagoon

bendy,

As you say, slow, but everything else looks ok.

Have you turned on accoustic management ?

That slows down head movements (and data rates) but the drives get quieter.

I think hdparm shows it.  

It domething common to the drives, since all partitions are slow, not only one.

yep 

```
$ sudo /sbin/hdparm -M /dev/hda   

/dev/hda:

 acoustic     =  0 (128=quiet ... 254=fast)
```

but I cn't get it to go on SATA

----------

## bendy

Well, I haven't deliberately enabled acoustic management, and indeed:

```
nickdesk nick # hdparm -M /dev/sda

/dev/sda:

 HDIO_GET_ACOUSTIC failed: Inappropriate ioctl for device
```

 it doesn't look like I could even if I wanted to....

----------

## NeddySeagoon

bendy,

Well, not using hdparm on SATA drives anyway ... but keep it in mind.

What about clock throttling, slowing everything down.

Can you test with a differernet kernel, or a liveCD ?

You need not bring up the raid set, speed tests on the underlying partitions will do.

----------

## bendy

Good idea - I'll try running hdparm from a livecd when I get home tonight.  I changed the subject line as it seems that the drives themselves are running slower, and the fact that they are in a raid array is not the issue.

I do have "cool n quiet" enabled and the cpu throttles back when not under load, but I wouldn't expect this to affect the hard drive read speed.

----------

## bendy

OK - I tried booting from a gentoo 2006.1 minimal livecd, and this gave buffered disk reads of 55 MB/sec.  This livecd has a 2.6.17-gentoo-r7 kernel.

I then tried booting from a xubuntu 6.10 cd which also has a 2.6.17 kernel, and this gave 54 MB/sec.

So both of these give better read performance than I am getting with my 2.6.18-gentoo-r5 kernel.  This means that either I have configured something badly that has hurt my hard drive performance, or the 2.6.18 kernel has got worse sata drivers for some reason.

I haven't kept anything older than 2.6.18 on my gentoo system, but I guess I could try a newer 2.6.19 kernel to see if things improve.

----------

## bendy

I probably should have mentioned - the 2 livecds I tried were 32 bit x86, whereas my hard disk install is 64 bit amd64.

----------

## NeddySeagoon

bendy,

I would be disappointed with all those figures. My 7200rpm SATA driver in raid0 give :-

```
sudo /sbin/hdparm -tT /dev/md1

/dev/md1:

 Timing cached reads:   1148 MB in  2.00 seconds = 574.05 MB/sec

 Timing buffered disk reads:  324 MB in  3.01 seconds = 107.58 MB/sec

```

and one of the underlying drives 

```
$ sudo /sbin/hdparm -tT /dev/sda

/dev/sda:

 Timing cached reads:   1124 MB in  2.00 seconds = 561.43 MB/sec

 Timing buffered disk reads:  182 MB in  3.04 seconds =  59.87 MB/sec
```

 The almost doubling of the buffered read speed is what you would expect. 

Ahhh ... there have been reports of different versions of hdparm giving different results ... by as mucch as a factor of 2x.

I have sys-apps/hdparm-6.9 and I know that its about right as 60 MB/sec is the platter/head data rate in my drives (or very close) So, is your system actually slow, or is hdparm telling lies. 

As you have 10,000rpm drives against my 7,200 rpm drives I would expect your data transfer rates to be 10/7.2 or 1.4 x faster than mine (all other things being equal). that gives your Raptors a head platter limit of about 84Mb/Sec. Your detialed post reported about half that ... hmm. Looks like your version of hdparm could do with being looked at.

----------

## bendy

Neddy,

I have hdparm-6.6 installed.  I also have hdparm-6.6 on my home server box which I build from a barebones system with a sempron processor and sis chipset (32 bit).  This has a single sata hard drive (7200 rpm) which gives:

```
newserver nick # hdparm -tT /dev/sda

/dev/sda:

 Timing cached reads:   2824 MB in  2.00 seconds = 1411.48 MB/sec

 Timing buffered disk reads:  188 MB in  3.02 seconds =  62.20 MB/sec
```

which is what I'd expect to see.

Is your system 32 or 64 bit?

----------

## NeddySeagoon

bendy,

My box is 32 bit.

----------

## bendy

I will post also in the amd64 forum, as I'm wondering if it's a 64 bit problem....

----------

## bendy

I'm still working on this.  With the latest stable gentoo 2.6.19-r5 kernel I get:

```
nickdesk nick # hdparm -tT /dev/md0

/dev/md0:

 Timing cached reads:   2400 MB in  2.00 seconds = 1198.98 MB/sec

 Timing buffered disk reads:  210 MB in  3.00 seconds =  69.99 MB/sec

nickdesk nick # hdparm -tT /dev/sda

/dev/sda:

 Timing cached reads:   2440 MB in  2.00 seconds = 1218.80 MB/sec

 Timing buffered disk reads:  134 MB in  3.01 seconds =  44.47 MB/sec

nickdesk nick # hdparm -tT /dev/sdb

/dev/sdb:

 Timing cached reads:   2440 MB in  2.00 seconds = 1219.99 MB/sec

 Timing buffered disk reads:  136 MB in  3.04 seconds =  44.80 MB/sec
```

I think that my problems started with =>2.6.17 kernels and discovered that I still had the ebuild and source files for the old gentoo 2.6.16-r13 kernel.  So, I build a kernel from this source with as close a config match as I could get.  Sure enough, with this kernel I get buffered disk reads of 107.15 MB/sec on the md0 raid array, and 54-55 MB/sec on the individual disks.

If I remember correctly, 2.6.17 was when libata gained pata disk support.  As my WD Raptors are actually ide drives with a sata bridge, I wonder if this is part of the problem.  If so, then it's an upstream kernel bug and nothing to do with gentoo....

----------

