Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Aug 2005 00:01:30 -0700
From:      Josh Carroll <josh.carroll@gmail.com>
To:        freebsd-performance@freebsd.org
Subject:   disk read vs. write performance in 5.4-RELEASE-p6
Message-ID:  <8cb6106e05080700016c4a065a@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hello,

After reading man tuning, I began poking around at my IDE drives to
see how their performance was in FreeBSD. I noticed that writes are
quite slow (on the order of 15MB/s) compared to reads (55MB/s).

In some initial googling, I saw a thread from early 2005 about 5.3 and
performance problems. I ran the same dd test to check if it
corroborated my results and sure enough it did.

Before I get to the results, the box is a Pentium 4 3.0 Ghz on an
Intel 865PERL motherboard running 5.4-RELEASE-p6. The kernel is a
custom kernel, but the results are the same with my kernel and with
GENERIC.  The IDE drives in question (all PATA) are two 80GB drives
(one 7200 rpm, one 5400 rpm) and a 120GB 7200rpm drive. The 80GB
7200rpm drive (ad0) is the primary master, the 80GB 5400rpm drive
(ad1) is the primary slave. The 120GB drive (ad2) is the secondary
master, with a DVD burner as the secondary slave.

Here are the dd results:

ad0(write): 1073741824 bytes transferred in 67.897021 secs (15814270 bytes/=
sec)
ad0(read): 1073741824 bytes transferred in 19.861379 secs (54061796 bytes/s=
ec)

ad1(write): 1073741824 bytes transferred in 73.247236 secs (14659145 bytes/=
sec)
ad1(read): 1073741824 bytes transferred in 26.235017 secs (40927811 bytes/s=
ec)

ad2(write): 1073741824 bytes transferred in 66.088393 secs (16247056 bytes/=
sec)
ad2(read): 1073741824 bytes transferred in 21.449289 secs (50059553 bytes/s=
ec)

The read numbers are right about where I would expect, and the 5400
rpm drive is slightly slower as I'd expect. However, all there drives
write at roughly the same speed. All around 15MB/s. And that's the
crux of the problem. I'm pretty sure this isn't "normal", as the
numbers look rather low. I had a few others test their IDE drives and
they reported at least 30MB/s.

syctl values look kosher:

# sysctl hw.ata
hw.ata.atapi_dma: 1
hw.ata.wc: 1
hw.ata.ata_dma: 1

As does the atacontrol output:

# atacontrol mode 0
Master =3D UDMA100
Slave  =3D UDMA100
# atacontrol mode 1
Master =3D UDMA100
Slave  =3D UDMA33

# atacontrol info 0
Master:  ad0 <ST380013A/3.06> ATA/ATAPI revision 6
Slave:   ad1 <ST380021A/3.10> ATA/ATAPI revision 5

# atacontrol info 1
Master:  ad2 <WDC WD1600JB-00EVA0/15.05R15> ATA/ATAPI revision 6
Slave:  acd0 <TEAC DVD+RW DV-W58E/D.0C> ATA/ATAPI revision 5

Finally, here is my dmesg output:

Copyright (c) 1992-2005 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
=09The Regents of the University of California. All rights reserved.
FreeBSD 5.4-RELEASE-p6 #3: Thu Aug  4 23:53:33 PDT 2005
    root@deblin.org:/usr/src/sys/i386/compile/DEBLIN
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel(R) Pentium(R) 4 CPU 3.00GHz (3000.12-MHz 686-class CPU)
  Origin =3D "GenuineIntel"  Id =3D 0xf41  Stepping =3D 1
  Features=3D0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PG=
E,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
  Hyperthreading: 2 logical CPUs
real memory  =3D 1073676288 (1023 MB)
avail memory =3D 1036939264 (988 MB)
ACPI APIC Table: <AMIINT INTEL865>
ioapic0 <Version 2.0> irqs 0-23 on motherboard
npx0: <math processor> on motherboard
npx0: INT 16 interface
acpi0: <AMIINT INTEL865> on motherboard
acpi0: Overriding SCI Interrupt from IRQ 9 to IRQ 20
acpi0: Power Button (fixed)
Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0
cpu0: <ACPI CPU> on acpi0
acpi_throttle0: <ACPI CPU Throttling> on cpu0
acpi_button0: <Power Button> on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
pcib1: <PCI-PCI bridge> at device 1.0 on pci0
pci1: <PCI bus> on pcib1
nvidia0: <GeForce4 Ti 4400> mem
0xf7d80000-0xf7dfffff,0xe8000000-0xefffffff,0xfd000000-0xfdffffff irq
16 at device 0.0 on pci1
uhci0: <Intel 82801EB (ICH5) USB controller USB-A> port 0xcc00-0xcc1f
irq 16 at device 29.0 on pci0
usb0: <Intel 82801EB (ICH5) USB controller USB-A> on uhci0
usb0: USB revision 1.0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1: <Intel 82801EB (ICH5) USB controller USB-B> port 0xd000-0xd01f
irq 19 at device 29.1 on pci0
usb1: <Intel 82801EB (ICH5) USB controller USB-B> on uhci1
usb1: USB revision 1.0
uhub1: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
uhci2: <Intel 82801EB (ICH5) USB controller USB-C> port 0xd400-0xd41f
irq 18 at device 29.2 on pci0
usb2: <Intel 82801EB (ICH5) USB controller USB-C> on uhci2
usb2: USB revision 1.0
uhub2: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub2: 2 ports with 2 removable, self powered
uhci3: <Intel 82801EB (ICH5) USB controller USB-D> port 0xd800-0xd81f
irq 16 at device 29.3 on pci0
usb3: <Intel 82801EB (ICH5) USB controller USB-D> on uhci3
usb3: USB revision 1.0
uhub3: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub3: 2 ports with 2 removable, self powered
ehci0: <EHCI (generic) USB 2.0 controller> mem 0xfebff800-0xfebffbff
irq 23 at device 29.7 on pci0
usb4: EHCI version 1.0
usb4: companion controllers, 2 ports each: usb0 usb1 usb2 usb3
usb4: <EHCI (generic) USB 2.0 controller> on ehci0
usb4: USB revision 2.0
uhub4: Intel EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub4: 8 ports with 8 removable, self powered
pcib2: <ACPI PCI-PCI bridge> at device 30.0 on pci0
pci2: <ACPI PCI bus> on pcib2
em0: <Intel(R) PRO/1000 Network Connection, Version - 1.7.35> port
0xbc00-0xbc3f mem 0xfeac0000-0xfeadffff,0xfeae0000-0xfeafffff irq 17
at device 1.0 on pci2
em0: Ethernet address: 00:0e:0c:6c:b9:16
em0:  Speed:N/A  Duplex:N/A
fxp0: <Intel 82557 Pro/100 Ethernet> port 0xb800-0xb81f mem
0xfe900000-0xfe9fffff,0xf7eff000-0xf7efffff irq 18 at device 2.0 on
pci2
miibus0: <MII bus> on fxp0
nsphy0: <DP83840 10/100 media interface> on miibus0
nsphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
fxp0: Ethernet address: 00:a0:c9:1f:ac:f8
isab0: <PCI-ISA bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel ICH5 UDMA100 controller> port
0xfc00-0xfc0f,0x376,0x170-0x177,0x3f6,0x1f0-0x1f7 at device 31.1 on
pci0
ata0: channel #0 on atapci0
ata1: channel #1 on atapci0
pci0: <serial bus, SMBus> at device 31.3 (no driver attached)
atkbdc0: <Keyboard controller (i8042)> port 0x64,0x60 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: model IntelliMouse, device ID 3
fdc0: <floppy drive controller> port 0x3f7,0x3f4-0x3f5,0x3f2-0x3f3 irq
6 drq 2 on acpi0
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on acp=
i0
sio0: type 16550A
sio1: <16550A-compatible COM port> port 0x3e8-0x3ef irq 4 on acpi0
sio1: type 16550A
pmtimer0 on isa0
orm0: <ISA Option ROMs> at iomem
0xe0000-0xe0fff,0xce800-0xcf7ff,0xc0000-0xce7ff on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=3D0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
ppc0: parallel port not found.
uhid0: APC Back-UPS ES 500 FW:801.e5.D USB FW:e5, rev 1.10/1.06, addr
2, iclass 3/0
Timecounter "TSC" frequency 3000123473 Hz quality 800
Timecounters tick every 10.000 msec
ad0: 76319MB <ST380013A/3.06> [155061/16/63] at ata0-master UDMA100
ad1: 76319MB <ST380021A/3.10> [155061/16/63] at ata0-slave UDMA100
ad2: 152627MB <WDC WD1600JB-00EVA0/15.05R15> [310101/16/63] at
ata1-master UDMA100
acd0: CDRW <TEAC DVD+RW DV-W58E/D.0C> at ata1-slave UDMA33
cd0 at ata1 bus 0 target 1 lun 0
cd0: <TEAC DVD+RW DV-W58E D.0C> Removable CD-ROM SCSI-0 device=20
cd0: 33.000MB/s transfers
cd0: cd present [348875 x 2048 byte records]

Thanks in advance!
Josh



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8cb6106e05080700016c4a065a>