From owner-freebsd-performance@FreeBSD.ORG Sun Aug 7 07:01:32 2005 Return-Path: X-Original-To: freebsd-performance@freebsd.org Delivered-To: freebsd-performance@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 568FB16A41F for ; Sun, 7 Aug 2005 07:01:32 +0000 (GMT) (envelope-from josh.carroll@gmail.com) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id CB23F43D6B for ; Sun, 7 Aug 2005 07:01:31 +0000 (GMT) (envelope-from josh.carroll@gmail.com) Received: by wproxy.gmail.com with SMTP id i8so818104wra for ; Sun, 07 Aug 2005 00:01:30 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=NnLQ09ryQktNvZKk2hjQkiKMAp/xpZ+MyRL3eMidWngI2sQlfKMDyxF7wbGd94QYm/fjPKKYxJlMBVQVPLZsgGFjp8142FEWlFPnlOexgy/2UYsa3dbhf0z4pKIQhD311uiGOMtirTa5BrXGfQhPVa9Nnj93rOaavzpkMidnnG4= Received: by 10.54.46.30 with SMTP id t30mr3984691wrt; Sun, 07 Aug 2005 00:01:30 -0700 (PDT) Received: by 10.54.14.51 with HTTP; Sun, 7 Aug 2005 00:01:30 -0700 (PDT) Message-ID: <8cb6106e05080700016c4a065a@mail.gmail.com> Date: Sun, 7 Aug 2005 00:01:30 -0700 From: Josh Carroll To: freebsd-performance@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: disk read vs. write performance in 5.4-RELEASE-p6 X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: josh.carroll@psualum.com List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2005 07:01:32 -0000 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 ATA/ATAPI revision 6 Slave: ad1 ATA/ATAPI revision 5 # atacontrol info 1 Master: ad2 ATA/ATAPI revision 6 Slave: acd0 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 Hyperthreading: 2 logical CPUs real memory =3D 1073676288 (1023 MB) avail memory =3D 1036939264 (988 MB) ACPI APIC Table: ioapic0 irqs 0-23 on motherboard npx0: on motherboard npx0: INT 16 interface acpi0: 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: on acpi0 acpi_throttle0: on cpu0 acpi_button0: on acpi0 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 pcib1: at device 1.0 on pci0 pci1: on pcib1 nvidia0: mem 0xf7d80000-0xf7dfffff,0xe8000000-0xefffffff,0xfd000000-0xfdffffff irq 16 at device 0.0 on pci1 uhci0: port 0xcc00-0xcc1f irq 16 at device 29.0 on pci0 usb0: 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: port 0xd000-0xd01f irq 19 at device 29.1 on pci0 usb1: 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: port 0xd400-0xd41f irq 18 at device 29.2 on pci0 usb2: 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: port 0xd800-0xd81f irq 16 at device 29.3 on pci0 usb3: 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: 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: 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: at device 30.0 on pci0 pci2: on pcib2 em0: 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: port 0xb800-0xb81f mem 0xfe900000-0xfe9fffff,0xf7eff000-0xf7efffff irq 18 at device 2.0 on pci2 miibus0: on fxp0 nsphy0: on miibus0 nsphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto fxp0: Ethernet address: 00:a0:c9:1f:ac:f8 isab0: at device 31.0 on pci0 isa0: on isab0 atapci0: 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: at device 31.3 (no driver attached) atkbdc0: port 0x64,0x60 irq 1 on acpi0 atkbd0: irq 1 on atkbdc0 kbd0 at atkbd0 psm0: irq 12 on atkbdc0 psm0: model IntelliMouse, device ID 3 fdc0: 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: at iomem 0xe0000-0xe0fff,0xce800-0xcf7ff,0xc0000-0xce7ff on isa0 sc0: at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=3D0x300> vga0: 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 [155061/16/63] at ata0-master UDMA100 ad1: 76319MB [155061/16/63] at ata0-slave UDMA100 ad2: 152627MB [310101/16/63] at ata1-master UDMA100 acd0: CDRW at ata1-slave UDMA33 cd0 at ata1 bus 0 target 1 lun 0 cd0: Removable CD-ROM SCSI-0 device=20 cd0: 33.000MB/s transfers cd0: cd present [348875 x 2048 byte records] Thanks in advance! Josh