# # 10-Jan-02 amo Date-of-Birth # # # ============================================ # Tuning your IDE disk for max transfer speeds # ============================================ # # Original Version # ---------------- # http://www.Linux-1U.net/Disks/hdparm.txt # # # Download hdparm # --------------- # # http://www.ibiblio.org/pub/Linux/system/hardware/ # http://metalab.unc.edu/pub/Linux/system/hardware/ # # http://ghdparm.sourceforge.net - GUI for hdparm # # # http://www.1U-Raid5.net/Disks # # -------------------------- # Don't Mix ATA drives types # -------------------------- # ATA-33, ata-66, ata-100, ata-133 # # # -- IDE Disk and IDE controllers defined to work with any combination # -- of situations using safe defaults # # # ============== # == # == CAUTION: # == # ============== # Playing with "disk options" could cause corruption with your filesystem # so back it up first # # # Very Good hdparam Articles # ========================= # # http://www.linuxdoc.org/LDP/solrhe/Securing-Optimizing-Linux-RH-Edition-v1.3/chap6sec74.html # # http://linux.oreillynet.com/pub/a/linux/2000/06/29/hdparm.html # http://linux.oreillynet.com/lpt/a/272 ( same as above ) # # http://www.linuxgazette.com/issue79/punk.html # # http://www.mandrakeuser.org/docs/hardware/hide2.html # # hdparm -Tt /dev/hda get around 3.5 MB/sec # ------------------- # # Turn on 32-bit I/O # hdparm -c3 /dev/hda get around 5.8 MB/sec # ------------------- # # Set (U)DMA # hdparm -d1 /dev/hda get around 15 MB/sec # ------------------- # # Other settings might not have any effect or might hang your system # -m16 enabling multiple sector count to 16 sectors ( 2, 4, 8, or 16 ) # ( hdparm -iv /dev/hda | grep MultSect ) # # -u1 unmasking interrupt ( on ) # let cpu service interrupts like NICs, while waiting for disk data to be returned # # -c obsolete ?? -- used on drives prior to 66/100 drives # -c3 setting 32-bit I/O support flag to 3 ( aka 32-bit w/sync ) # # -S240 sets the 'sleep option' for the hdd's to ~20 minutes # ( standby timeout -- your drive will spin down to save power ) # # -r readonly disk # # # UltraDMA Options ( -X ) # 33 multiword DMA mode1 == 32 + dmaN # 34 multiword DMA mode2 # # 66 UDMA2 ( ata-33 ) == 64 + udmaN # 68 UDMA4 ( ata-66 ) # 69 UDMA5 ( ata-100 ) # 70 UDMA6 ( ata-133 ?? ) # # # Add hdparm options in a /etc/rc.d/init.d/hdparm-settings or in /etc/rc.d/rc.local # # #Tweak drives for best speeds! # #WDC WD273BA 27.3GB 66MB/sec 7200RPM UDMA4 # hdparm -c1 -m0 -d1 -X68 -S253 /dev/hde # # # WDC WD400BB-00AUA1 40GB 100MB/sec 7200RPM UDMA5 # hdparm -c1 -m0 -d1 -X69 -S253 /dev/hdg # # # WDC WD102BA 10.2GB 66MB/sec 7200RPM UDMA4 # hdparm -c1 -m0 -d1 -X68 -S253 /dev/hdf # # # Which (U)DMA modes are supported by the disk: # hdparm -i /dev/hdx # -------------------- # DMA modes: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5 # # -- >> default is set to udma5 # # # # Very Good hdparam Article # ========================= # # http://linux.oreillynet.com/pub/a/linux/2000/06/29/hdparm.html # # # MultiCount # ----------- # Almost all modern IDE drives support this. # typically reduces operating system overhead for disk I/O by 30-50%. # # # I/O # ---- # Almost all modern controller chipsets support mode 3, or 32-bit mode w/sync. # Some even support 32-bit async. Turning this on will almost certainly double your throughput # # unmaskirq # --------- # lets Linux attend to other interrupt-related tasks (i.e., network traffic) # while waiting for your disk to return with the data it asked for # # using_dma # --------- # # # -T means to test the cache system (i.e., the memory, CPU, and buffer c ache). # -t means to report stats on the disk in question, reading data not in the cache # # But even with varying numbers, 3.58 MB/sec is PATHETIC for the above hardware. # I thought the ad for the HD said something about 66MB per second!!?!? What gives? # # # Ignore the first test result: Timing buffer-cache reads # Really important test result: Timing buffered disk reads # # # A. hdparm /dev/hda ( shows you adjustable parameters and their current setting ) # ---------------- # /dev/hda: # multcount = 0 (off) # I/O support = 0 (default 16-bit) # unmaskirq = 0 (off) # using_dma = 0 (off) # keepsettings = 0 (off) # nowerr = 0 (off) # readonly = 0 (off) # readahead = 8 (on) # geometry = 1870/255/63, sectors = 30043440, start = 0 # # # hdparm -Tt /dev/hda # ------------------- # Timing buffer-cache reads: 128 MB in 1.34 seconds =95.52 MB/sec # Timing buffered disk reads: 64 MB in 17.86 seconds = 3.58 MB/sec # # # B. hdparm -c3 -m16 /dev/hda # ------------------------ # setting 32-bit I/O support flag to 3 # setting multcount to 16 # multcount = 16 (on) # I/O support = 3 (32-bit w/sync) # # hdparm -tT /dev/hda # ------------------- # Timing buffer-cache reads: 128 MB in 1.41 seconds =90.78 MB/sec # Timing buffered disk reads: 64 MB in 9.84 seconds = 6.50 MB/sec # # # C. hdparm -X34 -d1 -u1 /dev/hda # - turn on multiword-DMA mode2 -- might hang some controllers # # # D. hdparm -X66 -d1 -u1 -m16 -c3 /dev/hda # ------------------------------------- # setting 32-bit I/O support flag to 3 # setting multcount to 16 # setting unmaskirq to 1 (on) # setting using_dma to 1 (on) # setting xfermode to 66 (UltraDMA mode2) # multcount = 16 (on) # I/O support = 3 (32-bit w/sync) # unmaskirq = 1 (on) # using_dma = 1 (on) # # hdparm -tT /dev/hda # ------------------- # Timing buffer-cache reads: 128 MB in 1.43 seconds =89.51 MB/sec # Timing buffered disk reads: 64 MB in 3.18 seconds =20.13 MB/sec # # # ============================================================================================ # # # test.pl - psuedo code # ---------------------- # while ( true ) { # print date, time and number of passes # cd /tmp ; rm -rf Test/* # cd /usr/local/src ; tar cf - linux-2.4.19 | ( cd /tmp/Test ; tar xvfp - ) # make dep ; make clean ; make bzImage # } # # # # 16-Oct-02 amo tests done on 6 AMD XP-xx00 systems # # # all are same motherboards ( Asus A7N266-VM ) w/ ( Redhat-8.0 w/ 2.4.19 ) # # all are same sdram ( except for that one boo-boo they had ) # # all are in udma5 mode, w/ dma=1 # 3rd XP-1700 was set as: hdparm -d1 -u1 -c3 /dev/hda # ---------------------------------------------------- # # all are sitting idle ... doding nothing else but this test.pl code # # # 1st column is number of kernel compile passes ( test.pl ) in 24hr period # ------------------------------------------------------------------------- # # pass Cpu Mem hdparm disk ata # 197 amd-1700 256MB 45.07 MB/sec maxtor 6Y060L0 - 60GB ata66/100 # 246 amd-1700 512MB 57.66 MB/sec maxtor 6E040L0 - 40GB ata133 241 amd-1700 512MB 57.66 MB/sec maxtor 6E040L0 - 40GB ata133 240 amd-1700 512MB 57.66 MB/sec maxtor 6E040L0 - 40GB ata133 # 245 amd-1800 512MB 57.14 MB/sec maxtor 6E040L0 - 40GB ata133 # 251 amd-1900 512MB 57.66 MB/sec maxtor 6E040L0 - 40GB ata133 # # # ------------------------------------------------------------------------------ # # 30-Nov-02 amo P4S533 w/ P4-2.4G w/ 512MB PC-2700 DDR # 5 min/pass 42.95 MB/sec P4S533 P4-2.4G 512MB PC-2700 Maxtor 6Y060L0 - 60GB ata133 # # # 05-Nov-02 amo Shuttle MV42N w/ P4-2.0GB w/ 512MB 32MB PC-133 SDRAM ( Suse-8.0 w/ 2.4.18 ) # 11 min/pass P4-2.0G 32MB ??? Maxtor 2B010H1 - 10GB ata133 ( skinny disks ) # # # # 05-Nov-02 amo Shuttle MV42N w/ P4-2.0GB w/ 512MB 256MB PC-133 SDRAM # # 06-Nov-02 amo Shuttle MV42N w/ P4-2.0GB w/ 512MB 256MB DDR SDRAM # # # ------------------------------------------------------------------------------------------------------ # # 05-Nov-02 amo Tusi-M w/ Celeron-1.2 "A" 256K L2 w/ laptop disks ( Redhat-8.0 w/ 2.4.19 ) # 38 min/pass Cel-1.2 512MB 19.22 MB/sec IBMLaptop IC25N020ATCS04-0 = 20GB ata66/100 5400rpm # # # # # end of file