home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / arch / 10525 < prev    next >
Encoding:
Internet Message Format  |  1992-11-08  |  7.2 KB

  1. Xref: sparky comp.arch:10525 comp.unix.bsd:8607 comp.os.linux:16036
  2. Path: sparky!uunet!dtix!darwin.sura.net!spool.mu.edu!agate!dog.ee.lbl.gov!horse.ee.lbl.gov!torek
  3. From: torek@horse.ee.lbl.gov (Chris Torek)
  4. Newsgroups: comp.arch,comp.unix.bsd,comp.os.linux
  5. Subject: Re: IDE faster than Mips SCSI disk?????
  6. Message-ID: <27298@dog.ee.lbl.gov>
  7. Date: 8 Nov 92 12:00:26 GMT
  8. References: <1992Nov6.033942.21194@ntuix.ntu.ac.sg> <1992Nov6.142946.17430@walter.bellcore.com>
  9. Reply-To: torek@horse.ee.lbl.gov (Chris Torek)
  10. Organization: Lawrence Berkeley Laboratory, Berkeley
  11. Lines: 123
  12. NNTP-Posting-Host: 128.3.112.15
  13.  
  14. In article <1992Nov6.142946.17430@walter.bellcore.com> mo@bellcore.com writes:
  15. >one must be very careful that one isn't comparing the
  16. >performance of two disk controllers and not the attached drives.
  17. >... the problem, however, is really *knowing* what one is measuring.
  18.  
  19. Indeed.  Mike O'Dell knows whereof he speaks.  In this case, of course, 
  20. the comparison is between overall system performance.
  21.  
  22. Whenever you run any benchmark, all you are *definitely* measuring is
  23. the speed of the system at that particular benchmark.  Running bonnie
  24. or iozone on a MIPS and a 386 box will tell you how fast those systems
  25. are at running bonnie or iozone.
  26.  
  27. Now, the authors of benchmarks try hard to write them such that they
  28. correlate well with performance at other things.  With any luck, the
  29. performance you get running bonnie is fairly indicative of the
  30. performance you will get running other I/O bound tasks.  But all you
  31. have really measured is overall system performance, NOT individual
  32. disk, controller, protocol, bus, cpu, memory, or kernel code
  33. performance.
  34.  
  35. If you can hold most of these variables constant, you may be able to
  36. get meaningful comparisons between IDE and SCSI drives, but in
  37. practise, you have to change at least two variables simultaneously.
  38.  
  39. As far as `knowing your measurements' goes...
  40.  
  41. In I/O, there are at least two interesting numbers: `latency' and
  42. `throughput'.  Latency is essentially `turnaround time'---the time lag
  43. from when you ask for something until when it actually happens.
  44. Throughput is `total work done'.  Usually you want small latencies and
  45. large throughput: things get done immediately, and lots of things
  46. get done.  But getting both is expensive.
  47.  
  48. As a general rule, things you do to reduce latency generally worsen
  49. throughput.  Things you do to increase throughput also increase
  50. latency.  (There are exceptions to this general rule.)
  51.  
  52. Large latencies do not necessarily reduce throughput.  At a busy
  53. supermarket, for instance, one generally has to wait in line quite a
  54. while (high latency) but the actual volume of people moving through all
  55. checkouts tends to be high.  (Supermarkets use parallelism: lots of
  56. lines.  This is one exception: parallelism generally improves
  57. throughput without having much effect on latency---but not always;
  58. it only helps if you do not run into another, separate bottleneck.)
  59.  
  60. With disk drives and controllers, fancy protocols can improve
  61. throughput (by allowing more stuff to run in parallel), but they often
  62. have a high cost in latency.  As others have noted, manufacturers are
  63. notoriously cheap, and tend to use 8085s and Z80s and such in their I/O
  64. devices.  These CPUs are horrendously slow, and take a long time to
  65. interpret the fancy protocols.
  66.  
  67. Raw disk throughput depends entirely on bit density.  If the platters
  68. spin at 3600 rpm, and there are 60 512-data-byte sectors on each track,
  69. we find that exactly 3600 sectors pass under the read/write head
  70. (assuming there is only one per track) each second.  This is 1.8 MB
  71. of data, and therefore the fastest the disk could possibly read or
  72. write is 1.8 MB/s.  Seek times and head switch or settle delays
  73. will only reduce this.
  74.  
  75. Disk latency is influenced by a number of factors.  Seek time is
  76. relevant, but the so-called `average seek time' is computed using a
  77. largely baseless assumption, namely that sectors are requested in a
  78. uniform random fashion.  In all real systems, sector requests follow
  79. patterns.  The exact patterns depends greatly on systemic details that
  80. are not well suited to analysis, so manufacturers use the randomness
  81. assumption and calculate average seek time using 1/3 the maximum stroke
  82. distance.  (Actuators tend to be nonlinear, so time(1/3 max distance)
  83. != 1/3 time(max distance).  On the other hand, the latter number is
  84. typically smaller; manufacturers may thus use it either out of
  85. `specsmanship' or simple ignorance....)
  86.  
  87. Rotational rate also affects latency.  The faster the disk spins, the
  88. faster any particular sector will appear under the heads.  On the other
  89. hand, if the disk spins quickly, and the overall system runs slowly,
  90. the next sector may have already `flown by' just after it gets
  91. requested.  This is called `blowing a rev', and is the basis of disk
  92. interleaving.  One can also compensate for this with track buffers, but
  93. those require hardware, which is considered expensive.  Interleaving
  94. can be done in software: in the drive, in the controller, in the
  95. driver, or in the file system, or in any combination thereof.  Figuring
  96. out where and when to interleave, and how much, is horrendously
  97. confusing, because all the factors affect each other, and they are
  98. usually not plainly labelled (they are all just called `the interleave
  99. factor', as if there were only one).
  100.  
  101. When you start building complete systems, other effects creep in.
  102. For instance, separate disk drives can seek separately, in parallel.
  103. Some busses permit this, some do not.  The SCSI protocol includes a
  104. SEEK command, which may or may not be implemented in any particular
  105. SCSI unit.  SCSI also allows `disconnecting', so that a target can
  106. release the bus while a disk seeks, but this requires cooperation
  107. from the host adapter.  Early versions of SCSI, and the original
  108. SASI from which SCSI evolved, did not permit disconnecting, so it
  109. was added as an option.
  110.  
  111. Disk controllers often have caches; these may or may not be separate
  112. from track buffers.  The algorithms used to fill and flush these
  113. caches will affect both latency and throughput.
  114.  
  115. The busses involved will put their own constraints on timing, affecting
  116. both latency and throughput.  The CPU's involvement, if any, will also
  117. affect both.  The design and coding of the kernel and the various
  118. drivers all have some effect.  Most Unix systems do memory-to-memory
  119. copies, whether as DMA from device memory into a buffer cache followed
  120. by buffer-to-user copies, or DMA directly to user space, or whatever;
  121. often this means that the memory bus speed controls total throughput.
  122. (It used to be that memory speeds outpaced peripheral speeds
  123. comfortably, and hence kernels did not need to worry about this.  Now
  124. the equations have changed, but many kernels have not.  Incidentally,
  125. note that DMA to user space has its drawbacks: if the resulting page is
  126. not copy-on-write or otherwise marked clean, a later request for the
  127. same sector must return to the disk, rather than reusing the cached
  128. copy.)
  129.  
  130. All in all, system characterisation is extremely difficult.  Single-
  131. number measures should be taken with an entire salt lick.  Good
  132. benchmarks must include more information---if nothing else, at least a
  133. complete system description.
  134. -- 
  135. In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 510 486 5427)
  136. Berkeley, CA        Domain:    torek@ee.lbl.gov
  137.