home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / question / 11110 < prev    next >
Encoding:
Text File  |  1992-09-15  |  8.6 KB  |  172 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!decwrl!pa.dec.com!nntpd2.cxo.dec.com!nabeth!alan
  3. From: alan@nabeth.enet.dec.com (Alan Rollow - Alan's Home for Wayward Tumbleweeds.)
  4. Subject: Re: Berkely Fast File System
  5. Message-ID: <1992Sep15.230627.16980@nntpd2.cxo.dec.com>
  6. Lines: 159
  7. Sender: alan@nabeth (Alan Rollow - Alan's Home for Wayward Tumbleweeds.)
  8. Reply-To: alan@nabeth.enet.dec.com (Alan Rollow - Alan's Home for Wayward Tumbleweeds.)
  9. Organization: Digital Equipment Corporation
  10. References:  <1992Sep7.085336.22530@nntp.uoregon.edu> <1992Sep9.025316.19275@nntpd2.cxo.dec.com> <BuBvL6.2MJ@gumby.ocs.com> <1992Sep12.003806.20983@nntpd2.cxo.dec.com>
  11. Date: Tue, 15 Sep 1992 23:06:27 GMT
  12.  
  13.  
  14. In article <1992Sep12.003806.20983@nntpd2.cxo.dec.com>, alan@nabeth.enet.dec.com (Alan Rollow - Alan's Home for Wayward Tumbleweeds.) writes:
  15.  
  16. >Recent improvements in the implementation of the Fast File System
  17. >by Sun and by DEC in ULTRIX V4.3 make this much less of a problem.
  18. >That will be the topic of my next post in this thread.
  19.  
  20. Get your ULTRIX manual pages handy and turn to section 8.  Find the
  21. manual page for tunefs(8).  Under the options section is the
  22. description of the -a option for setting the value of maxcontig.
  23.  
  24. I believe the intent is this is that the file will go along and
  25. take user I/O requests and break them up into appropriate file
  26. system block size (or fragment size) I/O requests and pass these
  27. off to the underlying driver.  It was expected that the driver
  28. would look at the requests close to notice if any requests just
  29. happened to be for contiguous blocks on the device.  Rather than
  30. issue many requests it would issue one larger request with
  31. appropriate page mapping to have the data end in the right
  32. place.  I'm not sure if there are any disk drivers that do
  33. this.  I know we (DEC) don't have any.
  34.  
  35. But, suppose you let the file system layer do this request
  36. aggregation.  It can do all the necessary page mapping to
  37. make a group of data buffers look contiguous and then use
  38. a large I/O request to the underlying driver for the data.
  39. Consider a sequential read.  Today, if the file system discovers
  40. that the user is going sequential reads, it will do a block
  41. (or more) of read-ahead for the next block.  With support
  42. for maxcontig it can assume that the data may have been
  43. written in long contiguous blocks and check.  When it finds
  44. that there are long contiguous block it can then read the
  45. current long block and start a read-ahead of the next long
  46. block.  You could easily get 128 KB into the buffer in two
  47. I/O requests.
  48.  
  49. On the write side, the file system can introduce a certain
  50. amount of delay between when it chooses WHERE to write a block
  51. and when it actually writes the block.  If it knows that there
  52. are a group of blocks all together for a particular file, it
  53. can map the data to look contiguous (if it isn't already) and
  54. do a single large write instead of many smaller writes.
  55.  
  56. Sun Microsystems added maxcontig support at least a year ago
  57. with what I hear where significant performance improvments
  58. for sequential I/O.  In ULTRIX V4.3 which should be available
  59. real soon, we have also added similar improvments.á  My experience
  60. with the ULTRIX support so far has been to use it to feed large
  61. I/O requests to a striping driver from the file system.  The
  62. results have been pretty impressive for having five disks on
  63. one SCSI controller.
  64.  
  65. The other options to tunefs(8) are less interesting, but still
  66. worth going through.  The -d option sets the rotational delay.
  67. As noted in a previous post, the intent is to place gaps in the
  68. block allocation that allow time for I/O requests to get to the
  69. controller in the hopes of missing rotation misses.  Depending
  70. on the value you set you can get gaps of zero, one, two and
  71. so on, file system block size blocks.  For the typical MSCP
  72. disk, arrangements might look like:
  73.  
  74.        8 KB
  75.      +------+------+------+------+------+------+------+
  76. 0 ms | data | data | data | data | data | data | data |
  77.      +------+------+------+------+------+------+------+
  78.  
  79.      +------+------+------+------+------+------+------+
  80. 4 ms | data |      | data |      | data |      | data |
  81.      +------+------+------+------+------+------+------+
  82.  
  83.      +------+------+------+------+------+------+------+
  84. 8 ms | data |      |      | data |      |      | data |
  85.      +------+------+------+------+------+------+------+
  86.  
  87. For the limited testing I've done, the only useful values seem
  88. to be 4 or 0.  Some gap is probably appropriate for disks that
  89. don't do their own read ahead.  For disks with read-head they
  90. will have cache one or more tracks.  By not putting in rotation
  91. delays you encourge the driver to make the block contiguous, which
  92. put more of them in the cache of the data, reducing the number reads
  93. it has do.  Even on disks with read-ahead, if you're willing to give
  94. up some read performance for improved write performance there might
  95. be some value in setting a rotation delay.  The only way to be sure
  96. is to experiment.
  97.  
  98. One thing to watch is that maxcontig and rotdelay can get in each
  99. other's way.  We recommend that if you use maxconfig that you set
  100. the rotdelay to 0.  What will happen if you don't is that you'll
  101. probably get a group of contiguous block seperated by a block size
  102. gap.  In this example an 8 KB block is indicated by a D with the
  103. gap by a space.
  104.  
  105.        +-----------------------------------+
  106. 288 KB |DDDDDDDD DDDDDDDD DDDDDDDD DDDDDDDD|
  107.        +-----------------------------------+
  108.  
  109. The gap might still help read/write performance on some disks, but
  110. it helps fragment the space more quickly.á  Having the space fragmented
  111. is probably not desirable.
  112.  
  113. Recall from probably the first post, that the block allocation scheme
  114. is to try and keep the block of a file in the same cylinder group
  115. as the file, UNLESS the file gets too big.  "To big" is determined
  116. from the "maxbpg", which can be set with the -e option.á  Our default
  117. for this 256 block or 2 MB.  The desired value really depends on how
  118. big the cylinder group is and how the disk is being used.  If the
  119. cylinder group is much larger than 2 MB then you might be able to
  120. raise it and still leave plenty of space for other files.  If the
  121. cylinder group is smaller than 2 MB you might want to lower it.
  122.  
  123. If the file system is going to hold exclusively large files, you
  124. might want to make the cylinder groups be very large and set maxbpg
  125. correspondingly large to keep the individual files as contiguous as
  126. possible.  To a limited extent you can use the -c option of newfs(8)
  127. to control the number of cylinders per group.  If you want to make
  128. them really large, you can lie about the geometry.  If your vendor
  129. supports the "Fat" version of the BSD file system, you may not need
  130. to lie.  I don't recall that much about it.
  131.  
  132. The last option to tunefs(8) is -m which is used to set the minfree
  133. value.  I haven't experimented with the perfomance loss of having to
  134. use the slower algorithms when the file system is full.  My inclination
  135. would be to change minfree only when:
  136.  
  137. 1.  Desperate for a little more user space.
  138. 2.  Setting up an archive disk, where space is going to be allocated
  139.     once up front and never or only rarely changed.
  140.  
  141. For the case of the archive disk, you can get a little extra space out
  142. of it at the expense of some files being badly allocated.  If the files
  143. are not frequently referenced this might not be a problem.
  144.  
  145. Specific to ULTRIX, we have a -c option change the our "clean byte"
  146. timeout factor.  The "clean byte" is a flag in the file system that
  147. is set when the file system is unmounted cleanly.  When the file system
  148. is mounted the flag is marked so as to be dirty.  Thus, if the system
  149. crashes it won't have been mounted cleanly.  If it was unmounted cleanly
  150. fsck(8) will not check it, unless forcably told do so.  The clean byte
  151. timeout was added so that you could force an fsck from time to time.
  152.  
  153. This covers the file system tuning that can be done with tunefs(8)
  154. dependent on the vendor supporting maxcontig in some way.  If anybody
  155. knows of other vendors (besides Sun and DEC) using the Fast File System
  156. that also support maxcontig, I'm interested in knowing who they are.
  157.  
  158. Potential topics for discussion next are "Stupid Pet File System Tricks"
  159. or "We Don't Need No Stinking Disk Defragmenters".  The first would be
  160. a discussion of using knowledge of how the file system allocates files
  161. to do additional location optimization by hand.  The other discusses
  162. the whether a disk defragmenter is interesting for the Fast File System.
  163. I'll probably be able to find time again on Thursday to post the next
  164. one.  Mail your suggestion before then...
  165.  
  166. >For now I'm off to see "Unforgiven"...
  167.  
  168. Didn't get there in time, so I saw "A League of their Own" instead...
  169. --
  170. Alan Rollow                alan@nabeth.cxo.dec.com
  171.  
  172.