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

📄 ch39_07.htm

📁 the unix power tools
💻 HTM
字号:
<HTML><!--Distributed by F --><HEAD><TITLE>[Chapter 39] 39.7 Checking System Load: uptime </TITLE><METANAME="DC.title"CONTENT="UNIX Power Tools"><METANAME="DC.creator"CONTENT="Jerry Peek, Tim O'Reilly &amp; Mike Loukides"><METANAME="DC.publisher"CONTENT="O'Reilly &amp; Associates, Inc."><METANAME="DC.date"CONTENT="1998-08-04T21:50:17Z"><METANAME="DC.type"CONTENT="Text.Monograph"><METANAME="DC.format"CONTENT="text/html"SCHEME="MIME"><METANAME="DC.source"CONTENT="1-56592-260-3"SCHEME="ISBN"><METANAME="DC.language"CONTENT="en-US"><METANAME="generator"CONTENT="Jade 1.1/O'Reilly DocBook 3.0 to HTML 4.0"><LINKREV="made"HREF="mailto:online-books@oreilly.com"TITLE="Online Books Comments"><LINKREL="up"HREF="ch39_01.htm"TITLE="39. Time and Performance"><LINKREL="prev"HREF="ch39_06.htm"TITLE="39.6 lastcomm: What Commands Are Running and How Long Do They Take?"><LINKREL="next"HREF="ch39_08.htm"TITLE="39.8 A Big Environment Can Slow You Down "></HEAD><BODYBGCOLOR="#FFFFFF"TEXT="#000000"><DIVCLASS="htmlnav"><H1><IMGSRC="gifs/smbanner.gif"ALT="UNIX Power Tools"USEMAP="#srchmap"BORDER="0"></H1><MAPNAME="srchmap"><AREASHAPE="RECT"COORDS="0,0,466,58"HREF="index.htm"ALT="UNIX Power Tools"><AREASHAPE="RECT"COORDS="467,0,514,18"HREF="jobjects/fsearch.htm"ALT="Search this book"></MAP><TABLEWIDTH="515"BORDER="0"CELLSPACING="0"CELLPADDING="0"><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch39_06.htm"TITLE="39.6 lastcomm: What Commands Are Running and How Long Do They Take?"><IMGSRC="gifs/txtpreva.gif"SRC="gifs/txtpreva.gif"ALT="Previous: 39.6 lastcomm: What Commands Are Running and How Long Do They Take?"BORDER="0"></A></TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><B><FONTFACE="ARIEL,HELVETICA,HELV,SANSERIF"SIZE="-1">Chapter 39<BR>Time and Performance</FONT></B></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch39_08.htm"TITLE="39.8 A Big Environment Can Slow You Down "><IMGSRC="gifs/txtnexta.gif"SRC="gifs/txtnexta.gif"ALT="Next: 39.8 A Big Environment Can Slow You Down "BORDER="0"></A></TD></TR></TABLE>&nbsp;<HRALIGN="LEFT"WIDTH="515"TITLE="footer"></DIV><DIVCLASS="SECT1"><H2CLASS="sect1"><ACLASS="title"NAME="UPT-ART-2000">39.7 Checking System Load: uptime </A></H2><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-43932"></A><ACLASS="indexterm"NAME="AUTOID-43934"></A>The BSD command <EMCLASS="emphasis">uptime</EM>, also available under System V Release 4,AIX, and some System V Release 3implementations, will give you a rough estimate of the system load:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">% <CODECLASS="userinput"><B>uptime</B></CODE>3:24pm up 2 days, 2:41, 16 users, load average: 1.90, 1.43, 1.33</PRE></BLOCKQUOTE></P><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-43942"></A><EMCLASS="emphasis">uptime</EM> reports the current time, the amount of time the system hasbeen up, and three load average figures. The load average is a roughmeasure of CPU use. These three figures report the average number ofprocesses active during the last minute, the last five minutes, and the last15 minutes. High load averages usually mean that the system is being usedheavily and the response time is correspondingly slow. Note that thesystem's load average does not take into account the priorities and<SPANCLASS="link"><EMCLASS="emphasis">niceness</EM> (<ACLASS="linkend"HREF="ch39_09.htm"TITLE='Know When to Be "nice&quot; to OTher Users...and WhenNot to'>39.9</A>)</SPAN>of theprocesses that are running.</P><PCLASS="para">What's high? As usual, that depends on your system. Ideally, you'd like aload average under, say, 3, but that's not always possible given what somesystems are required to do. Higher load averages are usually more tolerableon machines with more than one processor.Ultimately, &quot;high&quot; means high enough so that youdon't need <EMCLASS="emphasis">uptime</EM> to tell you that the system is overloaded&nbsp;- you cantell from its response time.</P><PCLASS="para">Furthermore, different systems will behave differently under the same loadaverage. For example, on some workstations, running a single CPU-boundbackground job at the same time as the<SPANCLASS="link">X Window System (<ACLASS="linkend"HREF="ch01_31.htm"TITLE="The X Window System ">1.31</A>)</SPAN>will bring response to a crawleven though the load average remains quite &quot;low.&quot; In the end, load averagesare significant only when they differ from whatever is &quot;normal&quot; on yoursystem.</P><DIVCLASS="sect1info"><PCLASS="SECT1INFO">- <SPANCLASS="authorinitials">AF</SPAN> <SPANCLASS="bibliomisc">from O'Reilly &amp; Associates' <CITECLASS="citetitle">Essential System Administration</CITE></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_06.htm"TITLE="39.6 lastcomm: What Commands Are Running and How Long Do They Take?"><IMGSRC="gifs/txtpreva.gif"SRC="gifs/txtpreva.gif"ALT="Previous: 39.6 lastcomm: What Commands Are Running and How Long Do They Take?"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="SECT1"HREF="ch39_08.htm"TITLE="39.8 A Big Environment Can Slow You Down "><IMGSRC="gifs/txtnexta.gif"SRC="gifs/txtnexta.gif"ALT="Next: 39.8 A Big Environment Can Slow You Down "BORDER="0"></A></TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172">39.6 lastcomm: What Commands Are Running and How Long Do They Take?</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">39.8 A Big Environment Can Slow You Down </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 + -