# Slow hard disk operations

## shadeheim

I have symptoms similar to others of slow file copying, hash checks and portage compiles. I've made sure DMA is enabled with the fastest mode possible. I've also checked the fragmentation and it seems OK at 0.57%. My disks have recently been checked for errors and it works fine in Windows. Please help me figure out the problem.

My startup config from /etc/conf.d/hdparm:

```

# /etc/conf.d/hdparm: config file for /etc/init.d/hdparm

# You can either set hdparm arguments for each drive using hdX_args,

# discX_args, cdromX_args and genericX_args, e.g.

#

hda_args="-d1 -X69"

hdb_args="-d1 -X69"

# disc1_args="-d1"

# cdrom0_args="-d1"

# or you can set options for all PATA drives

#pata_all_args="-d1"

# or you can set options for all SATA drives

#sata_all_args=""

# or, you can set hdparm options for all drives

#all_args=""

```

When I run hdparm -tT I get:

```

/dev/hdb7:

 Timing cached reads:   1164 MB in  2.00 seconds = 580.87 MB/sec

 Timing buffered disk reads:  128 MB in  3.02 seconds =  42.36 MB/sec

```

hdparm /dev/hdb/ gives:

```
/dev/hdb:

 multcount    = 16 (on)

 IO_support   =  1 (32-bit)

 unmaskirq    =  1 (on)

 using_dma    =  1 (on)

 keepsettings =  0 (off)

 readonly     =  0 (off)

 readahead    = 256 (on)

 geometry     = 16383/255/63, sectors = 234441648, start = 0

```

hdparm -I /dev/hdb7/ gives:

```

/dev/hdb7:

ATA device, with non-removable media

   Model Number:       WDC WD1200JB-00GVC0                     

   Serial Number:      WD-WCALA1885209

   Firmware Revision:  08.02D08

Standards:

   Supported: 6 5 4 

   Likely used: 6

Configuration:

   Logical      max   current

   cylinders   16383   65535

   heads      16   1

   sectors/track   63   63

   --

   CHS current addressable sectors:    4128705

   LBA    user addressable sectors:  234441648

   LBA48  user addressable sectors:  234441648

   device size with M = 1024*1024:      114473 MBytes

   device size with M = 1000*1000:      120034 MBytes (120 GB)

Capabilities:

   LBA, IORDY(can be disabled)

   Standby timer values: spec'd by Standard, with device specific minimum

   R/W multiple sector transfer: Max = 16   Current = 16

   Recommended acoustic management value: 128, current value: 254

   DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5 

        Cycle time: min=120ns recommended=120ns

   PIO: pio0 pio1 pio2 pio3 pio4 

        Cycle time: no flow control=120ns  IORDY flow control=120ns

Commands/features:

   Enabled   Supported:

      *   SMART feature set

          Security Mode feature set

      *   Power Management feature set

      *   Write cache

      *   Look-ahead

      *   Host Protected Area feature set

      *   WRITE_BUFFER command

      *   READ_BUFFER command

      *   DOWNLOAD_MICROCODE

          Power-Up In Standby feature set

      *   SET_FEATURES required to spinup after power up

          SET_MAX security extension

          Automatic Acoustic Management feature set

      *   48-bit Address feature set

      *   Device Configuration Overlay feature set

      *   Mandatory FLUSH_CACHE

      *   FLUSH_CACHE_EXT

      *   SMART error logging

      *   SMART self-test

Security: 

   Master password revision code = 65534

      supported

   not   enabled

   not   locked

   not   frozen

   not   expired: security count

   not   supported: enhanced erase

HW reset results:

   CBLID- above Vih

   Device num = 1 determined by the jumper

Checksum: correct

```

dmesg|grep ide gives:

```
BIOS-provided physical RAM map:

CPU: After generic identify, caps: 0383fbff c1c3fbff 00000000 00000000 00000000 00000000 00000000

Boot video device is 0000:01:00.0

ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx

    ide0: BM-DMA at 0xa800-0xa807, BIOS settings: hda:DMA, hdb:DMA

    ide1: BM-DMA at 0xa808-0xa80f, BIOS settings: hdc:DMA, hdd:pio

Probing IDE interface ide0...

ide0 at 0x1f0-0x1f7,0x3f6 on irq 14

Probing IDE interface ide1...

ide1 at 0x170-0x177,0x376 on irq 15

```

Whole dmesg:

```
Linux version 2.6.19-gentoo-r5 (root@Asus) (gcc version 4.1.1 (Gentoo 4.1.1)) #20 Sun Mar 18 22:25:03 GMT 2007

BIOS-provided physical RAM map:

 BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)

 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)

 BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)

 BIOS-e820: 0000000000100000 - 000000001fffc000 (usable)

 BIOS-e820: 000000001fffc000 - 000000001ffff000 (ACPI data)

 BIOS-e820: 000000001ffff000 - 0000000020000000 (ACPI NVS)

 BIOS-e820: 00000000fec00000 - 00000000fec01000 (reserved)

 BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)

 BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved)

0MB HIGHMEM available.

511MB LOWMEM available.

Entering add_active_range(0, 0, 131068) 0 entries of 256 used

Zone PFN ranges:

  DMA             0 ->     4096

  Normal       4096 ->   131068

  HighMem    131068 ->   131068

early_node_map[1] active PFN ranges

    0:        0 ->   131068

On node 0 totalpages: 131068

  DMA zone: 32 pages used for memmap

  DMA zone: 0 pages reserved

  DMA zone: 4064 pages, LIFO batch:0

  Normal zone: 991 pages used for memmap

  Normal zone: 125981 pages, LIFO batch:31

  HighMem zone: 0 pages used for memmap

DMI 2.3 present.

Using APIC driver default

ACPI: RSDP (v000 ASUS                                  ) @ 0x000f5f90

ACPI: RSDT (v001 ASUS   A7V8X    0x42302e31 MSFT 0x31313031) @ 0x1fffc000

ACPI: FADT (v001 ASUS   A7V8X    0x42302e31 MSFT 0x31313031) @ 0x1fffc0b2

ACPI: BOOT (v001 ASUS   A7V8X    0x42302e31 MSFT 0x31313031) @ 0x1fffc030

ACPI: MADT (v001 ASUS   A7V8X    0x42302e31 MSFT 0x31313031) @ 0x1fffc058

ACPI: DSDT (v001   ASUS A7V8X    0x00001000 MSFT 0x0100000b) @ 0x00000000

ACPI: PM-Timer IO Port: 0xe408

ACPI: Local APIC address 0xfee00000

ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)

Processor #0 6:8 APIC version 16

ACPI: LAPIC_NMI (acpi_id[0x00] high edge lint[0x1])

Allocating PCI resources starting at 30000000 (gap: 20000000:dec00000)

Detected 1800.231 MHz processor.

Built 1 zonelists.  Total pages: 130045

Kernel command line: root=/dev/hdb7 pci=noacpi

Found and enabled local APIC!

mapped APIC to ffffd000 (fee00000)

Enabling fast FPU save and restore... done.

Enabling unmasked SIMD FPU exception support... done.

Initializing CPU#0

PID hash table entries: 2048 (order: 11, 8192 bytes)

Console: colour VGA+ 80x25

Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)

Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)

Memory: 513472k/524272k available (2923k kernel code, 10188k reserved, 1348k data, 232k init, 0k highmem)

virtual kernel memory layout:

    fixmap  : 0xfffa9000 - 0xfffff000   ( 344 kB)

    pkmap   : 0xff800000 - 0xffc00000   (4096 kB)

    vmalloc : 0xe0800000 - 0xff7fe000   ( 495 MB)

    lowmem  : 0xc0000000 - 0xdfffc000   ( 511 MB)

      .init : 0xc059a000 - 0xc05d4000   ( 232 kB)

      .data : 0xc03dae54 - 0xc052c00c   (1348 kB)

      .text : 0xc0100000 - 0xc03dae54   (2923 kB)

Checking if this processor honours the WP bit even in supervisor mode... Ok.

Calibrating delay using timer specific routine.. 3602.09 BogoMIPS (lpj=7204189)

Mount-cache hash table entries: 512

CPU: After generic identify, caps: 0383fbff c1c3fbff 00000000 00000000 00000000 00000000 00000000

CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)

CPU: L2 Cache: 256K (64 bytes/line)

CPU: After all inits, caps: 0383fbff c1c3fbff 00000000 00000420 00000000 00000000 00000000

Intel machine check architecture supported.

Intel machine check reporting enabled on CPU#0.

Compat vDSO mapped to ffffe000.

CPU: AMD Athlon(TM) XP 2200+ stepping 00

Checking 'hlt' instruction... OK.

ACPI: Core revision 20060707

 tbxface-0107 [01] load_tables           : ACPI Tables successfully acquired

Parsing all Control Methods:

Table [DSDT](id 0005) - 336 Objects with 47 Devices 116 Methods 16 Regions

ACPI Namespace successfully loaded at root c0635610

evxfevnt-0089 [02] enable                : Transition to ACPI mode successful

NET: Registered protocol family 16

ACPI: bus type pci registered

PCI: PCI BIOS revision 2.10 entry at 0xf1730, last bus=1

PCI: Using configuration type 1

Setting up standard PCI resources

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

pci_get_subsys() called while pci_devices is still empty

evgpeblk-0951 [04] ev_create_gpe_block   : GPE 00 to 0F [_GPE] 2 regs on int 0x9

evgpeblk-1048 [03] ev_initialize_gpe_bloc: Found 4 Wake, Enabled 0 Runtime GPEs in this block

Completing Region/Field/Buffer/Package initialization:..................................................

Initialized 16/16 Regions 2/2 Fields 21/21 Buffers 11/11 Packages (345 nodes)

Initializing Device/Processor/Thermal objects by executing _INI methods:.

Executed 1 _INI methods requiring 0 _STA executions (examined 50 objects)

ACPI: Interpreter enabled

ACPI: Using PIC for interrupt routing

spurious 8259A interrupt: IRQ7.

SCSI subsystem initialized

libata version 2.00 loaded.

usbcore: registered new interface driver usbfs

usbcore: registered new interface driver hub

usbcore: registered new device driver usb

PCI: Probing PCI hardware

PCI: Probing PCI hardware (bus 00)

ACPI: Assume root bridge [\_SB_.PCI0] bus is 0

PCI quirk: region e400-e47f claimed by vt8235 PM

PCI quirk: region e800-e80f claimed by vt8235 SMB

Boot video device is 0000:01:00.0

PCI: Using IRQ router VIA [1106/3177] at 0000:00:11.0

PCI: Bridge: 0000:00:01.0

  IO window: disabled.

  MEM window: ee000000-ef5fffff

  PREFETCH window: ef700000-f7ffffff

PCI: Setting latency timer of device 0000:00:01.0 to 64

NET: Registered protocol family 2

IP route cache hash table entries: 4096 (order: 2, 16384 bytes)

TCP established hash table entries: 16384 (order: 4, 65536 bytes)

TCP bind hash table entries: 8192 (order: 3, 32768 bytes)

TCP: Hash tables configured (established 16384 bind 8192)

TCP reno registered

Simple Boot Flag at 0x3a set to 0x1

Machine check exception polling timer started.

microcode: CPU0 not a capable Intel processor

IA-32 Microcode Update Driver: v1.14a <tigran@veritas.com>

Total HugeTLB memory allocated, 0

Installing knfsd (copyright (C) 1996 okir@monad.swb.de).

io scheduler noop registered

io scheduler anticipatory registered (default)

io scheduler deadline registered

io scheduler cfq registered

Real Time Clock Driver v1.12ac

Linux agpgart interface v0.101 (c) Dave Jones

Hangcheck: starting hangcheck timer 0.9.0 (tick is 180 seconds, margin is 60 seconds).

Hangcheck: Using get_cycles().

ACPI: Power Button (FF) [PWRF]

ACPI: Power Button (CM) [PWRB]

Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled

serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A

serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A

Floppy drive(s): fd0 is 1.44M

FDC 0 is a post-1991 82077

RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize

loop: loaded (max 8 devices)

Intel(R) PRO/1000 Network Driver - version 7.2.9-k4

Copyright (c) 1999-2006 Intel Corporation.

e100: Intel(R) PRO/100 Network Driver, 3.5.17-k2-NAPI

e100: Copyright(c) 1999-2006 Intel Corporation

b44.c:v1.01 (Jun 16, 2006)

PCI: setting IRQ 9 as level-triggered

PCI: Found IRQ 9 for device 0000:00:09.0

PCI: Sharing IRQ 9 with 0000:00:0f.0

eth0: Broadcom 4400 10/100BaseT Ethernet 00:e0:18:a4:d9:c8

forcedeth.c: Reverse Engineered nForce ethernet driver. Version 0.57.

8139cp: 10/100 PCI Ethernet driver v1.3 (Mar 22, 2004)

8139cp 0000:00:0e.0: This (id 10ec:8139 rev 10) is not an 8139C+ compatible chip

8139cp 0000:00:0e.0: Try the "8139too" driver instead.

8139too Fast Ethernet driver 0.9.28

PCI: Found IRQ 9 for device 0000:00:0e.0

eth1: RealTek RTL8139 at 0xe080c000, 00:30:bd:27:4d:91, IRQ 9

eth1:  Identified 8139 chip type 'RTL-8100B/8139D'

netconsole: not configured, aborting

Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2

ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx

VP_IDE: IDE controller at PCI slot 0000:00:11.1

VP_IDE: chipset revision 6

VP_IDE: not 100% native mode: will probe irqs later

VP_IDE: VIA vt8235 (rev 00) IDE UDMA133 controller on pci0000:00:11.1

    ide0: BM-DMA at 0xa800-0xa807, BIOS settings: hda:DMA, hdb:DMA

    ide1: BM-DMA at 0xa808-0xa80f, BIOS settings: hdc:DMA, hdd:pio

Probing IDE interface ide0...

hda: WDC WD800JB-00CRA1, ATA DISK drive

hdb: WDC WD1200JB-00GVC0, ATA DISK drive

ide0 at 0x1f0-0x1f7,0x3f6 on irq 14

Probing IDE interface ide1...

hdc: PHILIPS DVDRW416N, ATAPI CD/DVD-ROM drive

ide1 at 0x170-0x177,0x376 on irq 15

hda: max request size: 128KiB

hda: 156301488 sectors (80026 MB) w/8192KiB Cache, CHS=65535/16/63, UDMA(100)

hda: cache flushes not supported

 hda: hda1

hdb: max request size: 512KiB

hdb: 234441648 sectors (120034 MB) w/8192KiB Cache, CHS=16383/255/63, UDMA(100)

hdb: cache flushes supported

 hdb: hdb1 hdb2 hdb3 hdb4 < hdb5 hdb6 hdb7 >

hdc: ATAPI 40X DVD-ROM CD-R/RW drive, 2048kB Cache, UDMA(33)

Uniform CD-ROM driver Revision: 3.20

3ware Storage Controller device driver for Linux v1.26.02.001.

Fusion MPT base driver 3.04.02

Copyright (c) 1999-2005 LSI Logic Corporation

Fusion MPT SPI Host driver 3.04.02

usbmon: debugfs is not available

PCI: setting IRQ 3 as level-triggered

PCI: Found IRQ 3 for device 0000:00:10.3

ehci_hcd 0000:00:10.3: EHCI Host Controller

ehci_hcd 0000:00:10.3: new USB bus registered, assigned bus number 1

ehci_hcd 0000:00:10.3: irq 9, io mem 0xec800000

ehci_hcd 0000:00:10.3: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004

usb usb1: configuration #1 chosen from 1 choice

hub 1-0:1.0: USB hub found

hub 1-0:1.0: 6 ports detected

ohci_hcd: 2006 August 04 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI)

USB Universal Host Controller Interface driver v3.0

PCI: Found IRQ 3 for device 0000:00:10.0

uhci_hcd 0000:00:10.0: UHCI Host Controller

uhci_hcd 0000:00:10.0: new USB bus registered, assigned bus number 2

uhci_hcd 0000:00:10.0: irq 9, io base 0x0000b800

usb usb2: configuration #1 chosen from 1 choice

hub 2-0:1.0: USB hub found

hub 2-0:1.0: 2 ports detected

PCI: Found IRQ 3 for device 0000:00:10.1

uhci_hcd 0000:00:10.1: UHCI Host Controller

uhci_hcd 0000:00:10.1: new USB bus registered, assigned bus number 3

uhci_hcd 0000:00:10.1: irq 9, io base 0x0000b400

usb usb3: configuration #1 chosen from 1 choice

hub 3-0:1.0: USB hub found

hub 3-0:1.0: 2 ports detected

PCI: Found IRQ 3 for device 0000:00:10.2

uhci_hcd 0000:00:10.2: UHCI Host Controller

uhci_hcd 0000:00:10.2: new USB bus registered, assigned bus number 4

uhci_hcd 0000:00:10.2: irq 9, io base 0x0000b000

usb usb4: configuration #1 chosen from 1 choice

hub 4-0:1.0: USB hub found

hub 4-0:1.0: 2 ports detected

usb 1-5: new high speed USB device using ehci_hcd and address 3

usb 1-5: no configuration chosen from 1 choice

usb 2-1: new low speed USB device using uhci_hcd and address 2

usb 2-1: configuration #1 chosen from 1 choice

usbcore: registered new interface driver usblp

drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver

Initializing USB Mass Storage driver...

usbcore: registered new interface driver usb-storage

USB Mass Storage support registered.

input: Microsoft Microsoft 5-Button Mouse with IntelliEye(TM) as /class/input/input0

input: USB HID v1.10 Mouse [Microsoft Microsoft 5-Button Mouse with IntelliEye(TM)] on usb-0000:00:10.0-1

usbcore: registered new interface driver usbhid

drivers/usb/input/hid-core.c: v2.6:USB HID core driver

serio: i8042 KBD port at 0x60,0x64 irq 1

serio: i8042 AUX port at 0x60,0x64 irq 12

mice: PS/2 mouse device common for all mice

oprofile: using NMI interrupt.

TCP cubic registered

NET: Registered protocol family 1

NET: Registered protocol family 10

IPv6 over IPv4 tunneling driver

NET: Registered protocol family 17

ieee80211: 802.11 data/management/control stack, git-1.1.13

ieee80211: Copyright (C) 2004-2005 Intel Corporation <jketreno@linux.intel.com>

ieee80211_crypt: registered algorithm 'NULL'

ieee80211_crypt: registered algorithm 'WEP'

ieee80211_crypt: registered algorithm 'CCMP'

ieee80211_crypt: registered algorithm 'TKIP'

powernow-k8: Processor cpuid 680 not supported

acpi_processor-0740 [00] processor_preregister_: Error while parsing _PSD domain information. Assuming no coordination

Testing NMI watchdog ... OK.

Using IPI Shortcut mode

ACPI: (supports S0 S1 S4 S5)

Time: tsc clocksource has been installed.

input: AT Translated Set 2 keyboard as /class/input/input1

kjournald starting.  Commit interval 5 seconds

EXT3-fs: mounted filesystem with ordered data mode.

VFS: Mounted root (ext3 filesystem) readonly.

Freeing unused kernel memory: 232k freed

PCI: Found IRQ 9 for device 0000:00:0f.0

PCI: Sharing IRQ 9 with 0000:00:09.0

nvidia: module license 'NVIDIA' taints kernel.

PCI: setting IRQ 11 as level-triggered

PCI: Found IRQ 11 for device 0000:01:00.0

NVRM: loading NVIDIA Linux x86 Kernel Module  1.0-8776  Mon Oct 16 21:56:04 PDT 2006

EXT3 FS on hdb7, internal journal

ndiswrapper version 1.33 loaded (preempt=no,smp=no)

usb 1-5: reset high speed USB device using ehci_hcd and address 3

ndiswrapper: driver bcmrndis (Belkin,12/16/2004, 4.01.20.2) loaded

wlan0: ethernet device 00:11:50:c6:04:6b using NDIS driver: bcmrndis, version: 0x4011405, NDIS version: 0x501, vendor: 'Belkin High-Speed Mode Wireless G USB Network Adapter', 050D:7051.F.conf

wlan0: encryption modes supported: WEP; TKIP with WPA, WPA2, WPA2PSK; AES/CCMP with WPA, WPA2, WPA2PSK

usbcore: registered new interface driver ndiswrapper

kjournald starting.  Commit interval 5 seconds

EXT3 FS on hdb3, internal journal

EXT3-fs: mounted filesystem with ordered data mode.

fuse init (API version 7.8)

fuse distribution version: 2.6.3

Adding 1028120k swap on /dev/hdb6.  Priority:-1 extents:1 across:1028120k

ADDRCONF(NETDEV_UP): wlan0: link is not ready

ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

wlan0: no IPv6 routers present

```

----------

## krinn

 *shadeheim wrote:*   

> 
> 
> ```
>  Timing buffered disk reads:  128 MB in  3.02 seconds =  42.36 MB/sec
> 
> ...

 

Yeah really slow harddisk, bellow 180 MB/sec it sucks no ?

no seriously what were you expecting?

----------

## JuNix

 *krinn wrote:*   

>  *shadeheim wrote:*   
> 
> ```
>  Timing buffered disk reads:  128 MB in  3.02 seconds =  42.36 MB/sec
> 
> ...

 

krinn: Well Shadeheim's got a WD Caviar PATA drive running in UDMA100 mode. It's *not* a slow ATA drive, see the spec sheet at (http://www.wdc.com/en/products/products.asp?DriveID=27). And I doubt anyone would get anywhere near 180MB/s on a UDMA100 which is 100MB/s by definition. Hell, I reckon you must be one of those SCSI speed freaks   :Cool: 

Shadeheim: You should be getting better transfer rate than that. I wouldn't trust the output of hdparm though, use better benchmarks like bonnie++ or iozone. Although 100MB/s is the theoretical maximum you would get, there are other factors like the platter speed, seek times and whatever else your machine may be doing in the background that will slow you down.Last edited by JuNix on Wed Apr 04, 2007 12:03 am; edited 2 times in total

----------

## JuNix

shadeheim: couple of things from your dmesg

```
io scheduler anticipatory registered (default) 
```

Your default IO elevator is anticipatory. You will probably find that changing this to CFQ improves your average IO response times *slightly*

```
EXT3 FS on hdb3, internal journal

EXT3-fs: mounted filesystem with ordered data mode. 
```

It's your choice, but ext3 is as slow as hell. There is (https://forums.gentoo.org/viewtopic-t-305871-highlight-ext3.html) as an example of how to tweak EXT3 for make it faster. The bit about directory indexing will help you *slightly*. I wouldn;t however advise enabling full data journalling in your case though. That will slow you down tenfold. Data journalling on ext3 is so SLOW. Even Ordered Data mode which you are using is damn slow.

Use a different filesystem, if you fancy it, both XFS and JFS are fast as hell if you tweak them. Actually ext2 is fastest at most things, and isn't journalled, so you'd need to wait for fsck after crashes. 

And of course...

```
 Automatic Acoustic Management feature set 
```

Disable that! Use hdparm -M0 /dev/hdb or hda or whatever

 *Quote:*   

> 
> 
>        -M     Get/set  Automatic  Acoustic  Management  (AAM)  setting. Most modern harddisk
> 
>               drives have the ability to speed down the head movements to reduce their noise
> ...

 

----------

## krinn

ok will not joke this time, so junix won't get mad again...

you're hdd speed is correct, don't think you should have 100MB/s on your drive because it's a pata 100!

42MB is a good speed, for a pata drive it's not "slow" !

i don't think it depend on the interface, 100MB, 133, 150, 300, pff who cares, it only depends on drives generation & cache... and controller driver.

i'm using intel new controller from kernel 2.6.20, all my drives are set as /dev/sd* and so hdparm fail on all of them. to get clear: i have not made & i'm unable to do anything to them with hdparm

WDC WD360ADFD-00NLR1 (sata 1 drive)

Timing buffered disk reads:  254 MB in  3.02 seconds =  84.13 MB/sec

WDC WD1600JS-00MHB0 (sata 2 drive, but on a sata 1 mb, not quite sure it's a sata 2 because i don't care, but hdparm say that)

Timing buffered disk reads:  182 MB in  3.01 seconds =  60.41 MB/sec

WDC WD2000JB-00GVA0 (ata)

Timing buffered disk reads:  172 MB in  3.01 seconds =  57.24 MB/sec

WDC WD800BB-75CAA0 (ata)

Timing buffered disk reads:  104 MB in  3.02 seconds =  34.41 MB/sec

i have 2 more WDC disk ata 80g

and as you see, i have nothing against western digital (junix will really be happy now)

----------

## shadeheim

Well I've followed the steps you suggested. I'll assume unmounting and running:

```

tune2fs -O dir_index /dev/hdb7

e2fsck -D /dev/hdb7

```

... worked because although I didn't get much output I didn't get any errors either.

I added elevator=cfq to my Grub kernel line and sure enough dmesg | grep sched lists:

```

io scheduler cfq registered (default)
```

But I'm not sure I applied hdparm -M0 /dev/hdb correctly...

```

/dev/hdb7:

 setting acoustic management to 0

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

```

because upon running hdparm -I /dev/hdb7 I still get:

```
Recommended acoustic management value: 128, current value: 254
```

and sadly still when I run hdparm there has been little increase

```
/dev/hdb7:

 Timing cached reads:   1212 MB in  2.00 seconds = 605.18 MB/sec

 Timing buffered disk reads:  132 MB in  3.01 seconds =  43.80 MB/sec
```

Even after I installed iozone when I ran iozone /dev/hdb7:

```
Iozone: Performance Test of File I/O

           Version $Revision: 3.242 $

      Compiled for 32 bit mode.

      Build: linux 

   Contributors:William Norcott, Don Capps, Isom Crawford, Kirby Collins

                Al Slater, Scott Rhine, Mike Wisner, Ken Goss

                Steve Landherr, Brad Smith, Mark Kelly, Dr. Alain CYR,

                Randy Dunlap, Mark Montague, Dan Million, 

                Jean-Marc Zucconi, Jeff Blomberg,

                Erik Habbinga, Kris Strecker, Walter Wong.

   Run began: Wed Apr  4 01:49:33 2007

   Command line used: iozone /dev/hdb7

   Output is in Kbytes/sec

   Time Resolution = 0.000001 seconds.

   Processor cache size set to 1024 Kbytes.

   Processor cache line size set to 32 bytes.

   File stride size set to 17 * record size.

                                                            random  random    bkwd  record  stride                                   

              KB  reclen   write rewrite    read    reread    read   write    read rewrite    read   fwrite frewrite   fread  freread

             512       4  181683  362349   479347   507428  704342  558947  455562  777977  461221   193940   322642  443304   496160

iozone test complete.

```

So I can thank you for the small increase, but I'm still in need of some more ideas. 

 *krinn wrote:*   

> you're hdd speed is correct, don't think you should have 100MB/s on your drive because it's a pata 100!
> 
> 42MB is a good speed, for a pata drive it's not "slow" ! 

 

Krinn: I'll take your word for it. I came in here with little idea of ideal speeds anyway. I was only trying to give you as much information as possible. The ok speeds don't change the fact that upon things like copy operations there seems to be uneccessary lags, and I'm not the only one who has reported this type of behavior. I remember one person was able to stop the lags by disabling SMART in his bios (mine appears to be off). That being said, it may not be the hard disk directly causing the problem.

----------

## shadeheim

 *JuNix wrote:*   

> Use a different filesystem, if you fancy it, both XFS and JFS are fast as hell if you tweak them. Actually ext2 is fastest at most things, and isn't journalled, so you'd need to wait for fsck after crashes. 

 

About XFS: Maybe I misread but I was told that although XFS is faster it is more suited to servers because crashes can cause data loss. I test out stuff a lot and I can think of a number of occasions where I've had to force a reboot because of some weird behavior. Can anyone give me a vague idea on how likely it is for data loss to occur on a forced reboot? Most of my coursework gets backed up through email so although I'd be pissed off losing a few mp3's I'd be willing to risk it if the speed increase is that noticeable.  Is the risk overstated?

----------

## JuNix

sorry - been away from home for a while...

about XFS: Crashes can cause data loss because XFS journals metadata only. If you are writing to a file and your system crashes, you may lose the contents of that file. You wouldn't lose random mp3's, because you almost never write to them. But the problem is not restricted to XFS; other filesystems have this problem too - all of them. Reiserfs, xfs, jfs, ext3 all suffer from this problem because they too only journal metadata. 

The only way to be truly safer from system crashes is to use a filesystem which journals both data and metadata. AFAIK the only one that does it is ext3, and even then you have to configure ext3 to do that, it doesn't journal data and metadata by default. By default, ext3 uses data=ordered mode which merely journals metadata. You can switch it to data=journal mode as described in the link I gave you above, and as I warned you, it is quite slow.

 *Quote:*   

> * journal mode
> 
> data=journal mode provides full data and metadata journaling.  All new data is
> 
> written to the journal first, and then to its final location.
> ...

 

@krinn: Sorry - I didn't realise you were only joking, I thought you were attacking shadeheim  :Embarassed: 

----------

