home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / wizards / 5359 < prev    next >
Encoding:
Internet Message Format  |  1993-01-01  |  4.3 KB

  1. Xref: sparky comp.unix.wizards:5359 comp.unix.bsd:10822
  2. Newsgroups: comp.unix.wizards,comp.unix.bsd
  3. Path: sparky!uunet!munnari.oz.au!metro!ipso!runxtsa!bde
  4. From: bde@runx.oz.au (Bruce Evans)
  5. Subject: Disk tuning (was Re: file system layout)
  6. Message-ID: <1993Jan1.102538.4626@runx.oz.au>
  7. Organization: RUNX Un*x Timeshare.  Sydney, Australia.
  8. References: <1992Dec30.163131.17280@ll.mit.edu> <lk6u47INN47f@appserv.Eng.Sun.COM> <28188@dog.ee.lbl.gov>
  9. Date: Fri, 1 Jan 93 10:25:38 GMT
  10. Lines: 76
  11.  
  12. In article <28188@dog.ee.lbl.gov> torek@horse.ee.lbl.gov (Chris Torek) writes:
  13. >Incidentally, Margo Seltzer found the following bug in the original BSD
  14. >block allocator:
  15. >
  16. >[ffs_alloc.c: your line numbers will differ; in fact your code might
  17. >even differ a bit, and/or be found in ufs_alloc.c.  Presumably this is
  18. >fixed in SunOS.]
  19. >***************
  20. >*** 458,464 ****
  21. >     */
  22. >    nextblk = bap[indx - 1] + fs->fs_frag;
  23. >!     if (indx > fs->fs_maxcontig &&
  24. >!         bap[indx - fs->fs_maxcontig] + blkstofrags(fs, fs->fs_maxcontig)
  25. >!         != nextblk)
  26. >        return (nextblk);
  27. >    if (fs->fs_rotdelay != 0)
  28. >--- 464,469 ----
  29. >     */
  30. >    nextblk = bap[indx - 1] + fs->fs_frag;
  31. >!     if (indx < fs->fs_maxcontig || bap[indx - fs->fs_maxcontig] +
  32. >!         blkstofrags(fs, fs->fs_maxcontig) != nextblk)
  33. >        return (nextblk);
  34. >    if (fs->fs_rotdelay != 0)
  35. >
  36.  
  37. >Kirk got the test backwards originally, so the tunefs -a parameter
  38. >never mattered....  I no longer have VAXen, but I am curious as to
  39. >whether this fix might improve performance on the old RA81 disks.  I
  40. >was never able to tune those at all; the performance was always
  41. >miserable, never more than a few hundred K per second.
  42.  
  43. 386BSD-0.1 still has the old version (assuming that the above patch is
  44. not backwards :-).
  45.  
  46. I tried tuning a Seagate 330MB ESDI disk under 386BSD yesterday.  The
  47. tunefs -a parameter worked like I expected: increasing it increased read
  48. performance and reduced write performance.  This is because my disk
  49. controller (a WD1007V-SE1) takes too long in between separate write
  50. commands and the 386BSD driver does not coalesce contiguous blocks
  51. into a single write command (nor does ufs give it enough opportunities
  52. to do so).  Separate read commands are not so much of a problem because
  53. the slow controller is disguised by caching in the controller.
  54.  
  55. I get best results with tunefs -a 1 -d 1 and a block size of 4K.  The
  56. default rotational delay is 4 msec, which corresponds to 14 sector times
  57. or 2 blocks or at best 33% efficiency :-(.  A rotational delay of 0
  58. works poorly for writing.  Rotational delays of 1 msec and 2 msec both
  59. correspond to 1 block and work OK (for at best 50% efficiency).  A larger
  60. block size wouldn't help because _some_delay between blocks is required,
  61. and the minimum delay of 1 block time always reduces the maximum
  62. efficiency to 50%.  (Actually, for large files I get very close to 25%
  63. efficiency on 15Mb/sec drive and not so close to 50% efficiency on a
  64. 10Mb/sec drive, because the faster drive has to be formatted at 2:1
  65. interleave for the controller's caching to keep up.  At 2:1 interleave
  66. the timing is not very critical so it is easier to get close to the
  67. maximum possible efficiency.)
  68.  
  69. Minix and linux (both using the minix-1.5 file system) get much better
  70. performance from this controller.  E.g., under my version of Minix
  71. (which is more or less standard except for the disk driver), reading and
  72. writing a 2MB file on recently built 64MB Minix file system with only
  73. 4MB free was about 50% faster than reading and writing a 2MB file on an
  74. empty 166MB 386BSD file system.  The minix-1.5 fs uses a block size of
  75. only 1K and attempts to lay out the blocks contiguously.  It uses my
  76. modifications of reading ahead up to 17K and always writing all dirty
  77. blocks whenever any dirty block has to be written, so that the driver
  78. usually has a large number of contiguous blocks to work with.  The
  79. driver collects disk-contiguous blocks and makes the largest possible
  80. i/o requests to the controller.  Directory blocks are _not_ written
  81. immediately. This goes well with writing all dirty blocks whenever one
  82. dirty block has to be written and makes operations like `ar xo libc.a'
  83. and `rm -rf junk' 10 to 20 times faster than with the 386BSD ufs.  It
  84. increases the chance of a crash messing up the file system, but I prefer
  85. the reduced chance of a crash because of less i/o.
  86. -- 
  87. Bruce Evans  (bde@runx.oz.au)
  88.