home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / wizards / 5234 < prev    next >
Encoding:
Internet Message Format  |  1992-12-15  |  6.4 KB

  1. Xref: sparky comp.unix.wizards:5234 comp.unix.admin:6653
  2. Newsgroups: comp.unix.wizards,comp.unix.admin
  3. Path: sparky!uunet!elroy.jpl.nasa.gov!swrinde!gatech!nntp.msstate.edu!news
  4. From: fwp@CC.MsState.Edu (Frank Peters)
  5. Subject: Re: Causes Of Death On Heavily-Loaded UNIX System?
  6. Message-ID: <1992Dec15.151754.27354@ra.msstate.edu>
  7. Sender: news@ra.msstate.edu
  8. Nntp-Posting-Host: jester.cc.msstate.edu
  9. Organization: Computing Center, Mississippi State University
  10. References: <1gjlnjINN9eb@smurf.sti.com>
  11. Date: Tue, 15 Dec 1992 15:17:54 GMT
  12. Lines: 117
  13.  
  14. In article <1gjlnjINN9eb@smurf.sti.com> westes@smurf.sti.com (Will Estes) says:
  15. : A local SunOS host is experiencing extremely poor performance, and I am
  16. : interested in understanding a little more about the dynamics of UNIX
  17. : performance given a large number of users.  The system in question is a
  18. : SPARC2 system that routinely gets about 80 users on it.  The workload
  19. : mix is probably something like this:
  20. : 50% mail
  21. : 30% news
  22. : 20% compiles or other activities with heavy file I/O
  23. : A typical symptom of poor performance on the subject system would be
  24. : very slow character echoing in a vi session, with occasional delays of
  25. : as much as 15 seconds when you type a character.
  26. : What are the major factors that contribute to performance death on a
  27. : system that is heavily loaded by the sheer number of users?  If you
  28. : could list the major causes of system slowdown, what would be the
  29. : percentage contribution of each cause to the total slowdown of performance 
  30. : of the system?  
  31. : I realize that performance is a very complex topic, and a lot depends on
  32. : particulars of a situation.  Still, I am hoping that some
  33. : generalizations can be made, even based on the sparse facts listed
  34. : above.  Thanks to all who respond.
  35.  
  36. There are some useful bits of information left out.  How much memory
  37. does the system have?  How many disks on how many controllers?  Are
  38. typical users connecting via telnet?  Are any of them running X
  39. applications (reading news via xvnews is a lot different from reading
  40. news via rn)?  Does the system have a graphic console that is in
  41. regular use?  Is the poor performance fairly steady or does it come in
  42. fits? (for example, does character echo get slow for a few seconds and
  43. then quick and then slow and then quick or does it get slow and stay
  44. slow for a while?)
  45.  
  46. Keeping what I don't know about your system and your last paragraph
  47. above firmly in mind I'd look at vmstat, ps and iostat and think about
  48. memory, disk IO and context switches.
  49.  
  50. Run the command "vmstat 5 10" and ignore the first line of data.
  51.  
  52. To the far left, under procs look at the b and w columns.  Ideally
  53. these should sit at 0.  Anything under the b column indicates processes
  54. blocked waiting for IO.  Any consistent numbers there can indicate a
  55. disk bottleneck among other things.  The w column is a more likely
  56. suspect.  It indicates potentially active jobs that are swapped out.
  57. Anything there is a sign of memory limitations.
  58.  
  59. Also look at the po column under the 'page' heading.  This indicates
  60. page outs and it too should ideally sit at 0.  Like the w column
  61. anything there can be a sign of memory shortage.
  62.  
  63. The cs culumn under the 'faults' heading indicates the context switch
  64. rate.  A lot of context switches can give a distinct knee in your
  65. system performance curves.  Unfortunately, there isn't any particular
  66. number to look for here and relatively little you can do about it.
  67. Different Sun systems have different numbers of hardware contexts and
  68. can thus deal with different context switch rates.  But such a change
  69. requires a system upgrade...you can't just by more context for your
  70. SS2.
  71.  
  72. Run "ps -au".  Look for individual processes using an unusually high
  73. %CPU or %MEM.  It only takes one process allocating 30MB of memory or
  74. using 30% of CPU to hit the whole system.  Often you can find some
  75. unusual process that you were unaware of which can be optimised in some
  76. way or run in off hours.
  77.  
  78. Under the STAT heading look for processes in P or D state.  These
  79. indicate processes waiting for page in or IO and can reflect memory or
  80. disk IO constraint.
  81.  
  82. Run "iostat -d 5 10".  If you have more than 4 disks use the -l option
  83. to display more drives ("iostat -l 5 -d 5 10" for 5 drives, for
  84. example).  Ignore the msps columns and the first line of data.  This
  85. gives a feel for how busy your disks are.
  86.  
  87. Using this information can be tricky.  The ideal, of course, is for all
  88. of your disks to be equivalent and have the load evenly distributed
  89. among them.  In practice different disks have different performance and
  90. without special disk striping software (like Online Disksuite) you may
  91. not be able to balance the load.  But if you see a lot of activity on
  92. your cheapest, slowest disk you may have found a bottleneck (especially
  93. if you found a lot of processes waiting for IO with vmstat and ps).  If
  94. you have more than one disk controller look at how the load is
  95. distributed between the controllers (are, for example, all of your busy
  96. disks on one controller).
  97.  
  98. These are all short term things to look at.  To really get a useful
  99. feel you need to run these things over the long term at relatively
  100. idle, moderately loaded and peak periods.  So many of the numbers
  101. reported by performance monitoring tools don't have any right answer.
  102. All you can do is look at them at various load levels and see which
  103. ones show unusual values when load is high.
  104.  
  105. Think hard about memory.  UNIX likes to have a lot of memory and when
  106. it runs out and has to start going to disk performance goes down hill
  107. fast.  This seems to be by far the most common constraint on most
  108. systems.
  109.  
  110. Also think hard about the disk system.  On larger systems disk load is
  111. distributed across multiple disks on multiple controllers.  Yet it is
  112. fairly common in the workstation server world to try to hang all of the
  113. disk of the single builtin SCSI controller with a few big disks.  You
  114. might be surprised at the performance boost a second (or third)
  115. controller would make if you don't already have them.
  116.  
  117. BIG DISCLAIMER TIME.  There are entire books written about performance
  118. tuning that cover a wide variety of issues like tuning kernel
  119. parameters and long term monitoring strategies.  I strongly suggest
  120. buying one of them.  These few lines (well...these several lines then)
  121. can only be a rough first pass at the task of finding out what your
  122. system is doing.
  123.  
  124. --
  125. Frank Peters  -  UNIX Systems Programmer  -  Mississippi State University
  126. Internet: fwp@CC.MsState.Edu  -  Phone: (601)325-7030  -  FAX: (601)325-8921
  127.