⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch39_12.htm

📁 the unix power tools
💻 HTM
📖 第 1 页 / 共 2 页
字号:
></DIV><DIVCLASS="sect2"><H3CLASS="sect2"><ACLASS="title"NAME="UPT-ART-67-SECT-1.3">39.12.3 The I/O Subsystem </A></H3><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-44348"></A><ACLASS="indexterm"NAME="AUTOID-44350"></A><ACLASS="indexterm"NAME="AUTOID-44353"></A><ACLASS="indexterm"NAME="AUTOID-44355"></A><ACLASS="indexterm"NAME="AUTOID-44358"></A><ACLASS="indexterm"NAME="AUTOID-44361"></A><ACLASS="indexterm"NAME="AUTOID-44363"></A><ACLASS="indexterm"NAME="AUTOID-44365"></A>The I/O subsystem is a common source of resource contention problems.A finite amount of I/O bandwidth must be shared by all the programs(including the UNIX kernel) that currently run. The system'sI/O buses can transfer only so many megabytes per second; individualdevices are even more limited. Each kind of device has its ownpeculiarities and, therefore, its own problems. Unfortunately, UNIX has poor tools for analyzing the I/O subsystem.Under BSD UNIX, <EMCLASS="emphasis">iostat</EM> can give you information about thetransfer rates for each disk drive; <EMCLASS="emphasis">ps</EM> and <EMCLASS="emphasis">vmstat</EM> can give some informationabout how many processes are blocked waiting for I/O; and<EMCLASS="emphasis">netstat</EM> and <EMCLASS="emphasis">nfsstat</EM> report various network statistics.Under System V, <EMCLASS="emphasis">sar</EM> can provide voluminous information about I/Oefficiency, and <EMCLASS="emphasis">sadp</EM> (V.4) can give detailed information aboutdisk access patterns. However, there is no standard tool to measurethe I/O subsystem's response to a heavy load.</P><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-44375"></A><ACLASS="indexterm"NAME="AUTOID-44378"></A><ACLASS="indexterm"NAME="AUTOID-44380"></A>The disk and network subsystems are particularly important to overallperformance. Disk bandwidth issues have two general forms:maximizing per-processtransfer rates and maximizing aggregate transfer rates. Theper-process transfer rate is the rate at which a single program canread or write data. The aggregate transfer rate is the maximum totalbandwidth that the system can provide to all programs that run.</P><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-44383"></A>Network I/O problems have two basic forms: a network can beoverloaded or a network can lose data integrity. When a network isoverloaded, the amount of data that needs to be transferred across thenetwork is greater than the network's capacity; therefore, the actualtransfer rate for any task is relatively slow. Network load problemscan usually be solved by changing the network's configuration.Integrity problems occur when the network is faulty andintermittently transfers data incorrectly. In order to delivercorrect data to the applications using the network, the networkprotocols may have to transmit each block of data many times.Consequently, programs using the network will run veryslowly. The only way to solve a data integrity problem is to isolatethe faulty part of the network and replace it.</P></DIV><DIVCLASS="sect2"><H3CLASS="sect2"><ACLASS="title"NAME="UPT-ART-67-SECT-1.4">39.12.4 User Communities </A></H3><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-44388"></A><ACLASS="indexterm"NAME="AUTOID-44391"></A>So far we have discussed the different factors that contribute tooverall system performance. But we have ignored one of the mostimportant factors: the users who submit the jobs.</P><PCLASS="para">In talking about the relationship between users and performance, it iseasy to start seeing users as problems: the creatures who keep yoursystem from running the way it ought to. Nothing is further from thetruth.Computers are tools: they exist to help usersdo their work and not vice versa.</P><PCLASS="para">Limitations on memory requirements, file size, jobpriorities, etc., are effective only when everyone cooperates.Likewise, you can't force people to submit their jobs to a<SPANCLASS="link">batch queue (<ACLASS="linkend"HREF="ch40_06.htm"TITLE="System V.4 Batch Queues ">40.6</A>)</SPAN>.Most people will cooperate when they understand a problem and whatthey can do to solve it. Most people will resist a solutionthat is imposed from above, that they don't understand, or thatseems to get in the way of their work.</P><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-44398"></A>The nature of your system's users has a big effect on yoursystem's performance.We can divide users into several classes:</P><ULCLASS="itemizedlist"><LICLASS="listitem"><PCLASS="para">Users who run a large number of relatively small jobs: for example,users who spend most of their time editing or running UNIX utilities.</P></LI><LICLASS="listitem"><PCLASS="para">Users who run a small number of relatively large jobs: for example,users who run large simulation programs with huge data files.</P></LI><LICLASS="listitem"><PCLASS="para">Users who run a small number of CPU-intensive jobs that don't requirea lot of I/O but do require a lot of memory and CPU time.  Programdevelopers fall into this category. Compilers tend to be largeprograms that build large data structures and can be a source ofmemory contention problems.</P></LI></UL><PCLASS="para">All three groups can cause problems. Several dozen users running<EMCLASS="emphasis">grep</EM> and accessing remote filesystems can be as bad for overallperformance as a few users accessing gigabyte files. However, thetypes of problems these groups cause are not the same. For example,setting up a &quot;striped filesystem&quot; will help disk performance forlarge, I/O-bound jobs but won't help (and may hurt) users who run manysmall jobs. Setting up batch queues will help reduce contention amonglarge jobs, which can often be run overnight, but it won't help thesystem if its problems arise from users typing at their text editors and reading their mail.</P><PCLASS="para">Modern systems with<SPANCLASS="link">network facilities (<ACLASS="linkend"HREF="ch01_33.htm"TITLE="UNIX Networking and Communications ">1.33</A>)</SPAN>complicate the picture even more.  In addition to knowing what kindsof work users do, you also need to know what kind of equipment theyuse: a standard terminal over an RS-232 line, an X terminal overEthernet, ora diskless workstation? The X Window System requires a lot of memoryand puts a heavy load on the network. Likewise, diskless workstationsplace a load on the network. Similarly, do users access local files orremote files via NFS or RFS?</P></DIV><DIVCLASS="sect1info"><PCLASS="SECT1INFO">- <SPANCLASS="authorinitials">ML</SPAN> <SPANCLASS="bibliomisc">from O'Reilly &amp; Associates' <CITECLASS="citetitle">System Performance Tuning</CITE>, Chapter 1</SPAN></P></DIV></DIV><DIVCLASS="htmlnav"><P></P><HRALIGN="LEFT"WIDTH="515"TITLE="footer"><TABLEWIDTH="515"BORDER="0"CELLSPACING="0"CELLPADDING="0"><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch39_11.htm"TITLE="39.11 Changing a Job's Priority Under BSD UNIX "><IMGSRC="gifs/txtpreva.gif"SRC="gifs/txtpreva.gif"ALT="Previous: 39.11 Changing a Job's Priority Under BSD UNIX "BORDER="0"></A></TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><ACLASS="book"HREF="index.htm"TITLE="UNIX Power Tools"><IMGSRC="gifs/txthome.gif"SRC="gifs/txthome.gif"ALT="UNIX Power Tools"BORDER="0"></A></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172"><ACLASS="CHAPTER"HREF="ch40_01.htm"TITLE="40. Delayed Execution"><IMGSRC="gifs/txtnexta.gif"SRC="gifs/txtnexta.gif"ALT="Next: 40. Delayed Execution"BORDER="0"></A></TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172">39.11 Changing a Job's Priority Under BSD UNIX </TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><ACLASS="index"HREF="index/idx_0.htm"TITLE="Book Index"><IMGSRC="gifs/index.gif"SRC="gifs/index.gif"ALT="Book Index"BORDER="0"></A></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172">40. Delayed Execution</TD></TR></TABLE><HRALIGN="LEFT"WIDTH="515"TITLE="footer"><IMGSRC="gifs/smnavbar.gif"SRC="gifs/smnavbar.gif"USEMAP="#map"BORDER="0"ALT="The UNIX CD Bookshelf Navigation"><MAPNAME="map"><AREASHAPE="RECT"COORDS="0,0,73,21"HREF="../index.htm"ALT="The UNIX CD Bookshelf"><AREASHAPE="RECT"COORDS="74,0,163,21"HREF="index.htm"ALT="UNIX Power Tools"><AREASHAPE="RECT"COORDS="164,0,257,21"HREF="../unixnut/index.htm"ALT="UNIX in a Nutshell"><AREASHAPE="RECT"COORDS="258,0,321,21"HREF="../vi/index.htm"ALT="Learning the vi Editor"><AREASHAPE="RECT"COORDS="322,0,378,21"HREF="../sedawk/index.htm"ALT="sed &amp; awk"><AREASHAPE="RECT"COORDS="379,0,438,21"HREF="../ksh/index.htm"ALT="Learning the Korn Shell"><AREASHAPE="RECT"COORDS="439,0,514,21"HREF="../lrnunix/index.htm"ALT="Learning the UNIX Operating System"></MAP></DIV></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -