<chapter id="spconcepts-21354"><title>Managing System
Performance (Overview)</title><highlights><para>Achieving good performance from a computer or network is an important
part of system administration. This chapter provides an overview of some factors
that contribute to managing the performance of the computer systems in your
care.</para><itemizedlist><para>This is a list of the overview information in this chapter.</para><listitem><para><olink targetptr="fqvas" remap="internal">What's New in Managing System Performance?</olink></para>
</listitem><listitem><para><olink targetptr="spconcepts-32" remap="internal">Where to Find System Performance
Tasks</olink></para>
</listitem><listitem><para><olink targetptr="spconcepts-19978" remap="internal">System Performance and
System Resources</olink></para>
</listitem><listitem><para><olink targetptr="spconcepts-30492" remap="internal">Processes and System Performance</olink></para>
</listitem><listitem><para><olink targetptr="spconcepts-38776" remap="internal">About Monitoring System
Performance</olink></para>
</listitem>
</itemizedlist>
</highlights><sect1 id="fqvas"><title>What's New in Managing System Performance?</title><para>This section describes new or changed features in managing system performance
in the Solaris release. </para><sect2 id="exlvn"><title>Enhanced <command>pfiles</command> Tool</title><para><emphasis role="strong">Solaris 10:</emphasis> The <filename>/proc</filename> file
system has been enhanced to include file name information in the <filename>/proc/<replaceable>pic</replaceable>/path</filename> directory. This information is used by <command>pfiles</command> to display file names for each file in the process. This
change provides new insight into process behavior. For more information, see <olink targetptr="spprocess-29852" remap="internal">How to Display Information About Processes</olink> and
the <olink targetdoc="refman" targetptr="proc-1" remap="external"><citerefentry><refentrytitle>proc</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man page.</para>
</sect2><sect2 id="eekjx"><title>CPU Performance Counters</title><para><emphasis role="strong">Solaris 10:</emphasis> The CPU Performance Counter
(CPC) system has been updated to give better access to the performance analysis
features available in the SPARC and x86 platforms that run the Solaris Operating
System.</para><para>The CPC commands <command>cpustat</command> and <command>cputrack</command> have
enhanced, command-line syntax for specifying CPU information. For example,
in previous versions of the Solaris OS, you were required to specify two counters.
The configuration of both commands now allows you to specify only one counter,
as shown in the following example:</para><screen># <userinput>cputrack -c pic0=Cycle_cnt ls -d</userinput> .
time lwp      event      pic0      pic1
.
0.034   1       exit    841167 </screen><para>For simple measurements, you can even omit the counter configuration,
as shown in the following example:</para><screen># <userinput>cputrack -c Cycle_cnt ls -d</userinput> .
   time lwp      event      pic0      pic1
  .
  0.016   1       exit    850736 </screen><para>For more information on using the <command>cpustat</command> command,
see the <olink targetdoc="refman" targetptr="cpustat-1m" remap="external"><citerefentry><refentrytitle>cpustat</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page. For more information on using the <command>cputrack</command> command,
see the <olink targetdoc="refman" targetptr="cputrack-1" remap="external"><citerefentry><refentrytitle>cputrack</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man
page.</para>
</sect2>
</sect1><sect1 id="spconcepts-32"><title>Where to Find System Performance Tasks</title><informaltable frame="topbot"><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="colspec2" colwidth="50*"/><colspec colname="colspec3" colwidth="50*"/><thead><row rowsep="1"><entry><para>System Performance Task</para>
</entry><entry><para>For More Information</para>
</entry>
</row>
</thead><tbody><row><entry><para>Manage processes</para>
</entry><entry><para><olink targetptr="spprocess-59633" remap="internal">Chapter&nbsp;12, Managing System
Processes (Tasks)</olink></para>
</entry>
</row><row><entry><para>Monitor system performance</para>
</entry><entry><para><olink targetptr="spmonitor-24844" remap="internal">Chapter&nbsp;13, Monitoring System
Performance (Tasks)</olink></para>
</entry>
</row><row><entry><para>Change Solaris tunable parameters</para>
</entry><entry><para><olink type="auto-generated" targetdoc="soltuneparamref" remap="external"><citetitle remap="book">Solaris Tunable Parameters Reference Manual</citetitle></olink></para>
</entry>
</row><row><entry><para>Manage System Performance Tasks</para>
</entry><entry><para><olink targetdoc="sysadrm" targetptr="rmtaskproj-1" remap="external">Chapter 2, <citetitle remap="chapter">Projects and Tasks (Overview),</citetitle> in <citetitle remap="book">System Administration Guide:  Virtualization Using the Solaris Operating System</citetitle></olink></para>
</entry>
</row><row><entry><para>Manage Processes With FX and FS Schedulers</para>
</entry><entry><para><olink targetdoc="sysadrm" targetptr="rmfss-1" remap="external">Chapter 8, <citetitle remap="chapter">Fair Share Scheduler (Overview),</citetitle> in <citetitle remap="book">System Administration Guide:  Virtualization Using the Solaris Operating System</citetitle></olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="spconcepts-19978"><title>System Performance and System Resources</title><para>The performance of a computer system
depends upon how the system uses and allocates its resources. Monitor your
system's performance regularly so that you know how it behaves under normal
conditions. You should have a good idea of what to expect, and be able to
recognize a problem when it occurs. </para><para>System resources that affect performance are described in the following
table.</para><informaltable frame="topbot"><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="colspec0" colwidth="50*"/><colspec colname="colspec1" colwidth="50*"/><thead><row rowsep="1"><entry><para>System Resource</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para>Central processing unit (CPU)</para>
</entry><entry><para>The CPU processes instructions by fetching instructions from memory
and executing them. </para>
</entry>
</row><row><entry><para>Input/output (I/O) devices</para>
</entry><entry><para>I/O devices transfer information into and out of the computer. Such
a device could be a terminal and keyboard, a disk drive, or a printer. </para>
</entry>
</row><row><entry><para>Memory</para>
</entry><entry><para>Physical (or main) memory is the amount of random access memory (RAM)
on the system. </para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable><para><olink targetptr="spmonitor-24844" remap="internal">Chapter&nbsp;13, Monitoring System
Performance (Tasks)</olink> describes the tools that display statistics about
the system's activity and performance.</para>
</sect1><sect1 id="spconcepts-30492"><title>Processes and System Performance</title><para>The following table describes terms that are related to processes. </para><table frame="topbot" id="spconcepts-99537"><title>Process Terminology</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="column1" colwidth="108*"/><colspec colname="column2" colwidth="252*"/><thead><row rowsep="1"><entry><para>Term</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para>Process </para>
</entry><entry><para>Any system activity or job. Each time you boot a system, execute a command,
or start an application, the system activates one or more processes.</para>
</entry>
</row><row><entry><para>Lightweight process (LWP) </para>
</entry><entry><para>A virtual CPU or execution resource. LWPs are scheduled by the kernel
to use available CPU resources based on their scheduling class and priority.
LWPs include a kernel thread and an LWP. A kernel thread contains information
that has to be in memory all the time. An LWP contains information that is
swappable.</para>
</entry>
</row><row><entry><para>Application thread </para>
</entry><entry><para>A series of instructions with a separate stack that can execute independently
in a user's address space. Application threads can be multiplexed on top of
LWPs.</para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>A process
can consist of multiple LWPs and multiple application threads. The kernel
schedules a kernel-thread structure, which is the scheduling entity in the
SunOS environment. Various process structures are described in the following
table.     </para><table frame="topbot" id="spconcepts-42581"><title>Process Structures</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="column1" colwidth="108*"/><colspec colname="column2" colwidth="252*"/><thead><row rowsep="1"><entry><para>Structure</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>proc</literal> </para>
</entry><entry><para>Contains information that pertains to the whole process and must be
in main memory all the time</para>
</entry>
</row><row><entry><para><literal>kthread</literal> </para>
</entry><entry><para>Contains information that pertains to one LWP and must be in main memory
all the time</para>
</entry>
</row><row><entry><para><literal>user</literal> </para>
</entry><entry><para>Contains the &ldquo;per process&rdquo; information that is swappable</para>
</entry>
</row><row><entry><para><literal>klwp</literal> </para>
</entry><entry><para>Contains the &ldquo;per LWP process&rdquo; information that is swappable</para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>The following figure illustrates the relationships among these process
structures.</para><figure id="spconcepts-fig-2"><title id="spconcepts-30420">Relationships Among
Process Structures</title><mediaobject><imageobject><imagedata entityref="fig2060.epsi"/>
</imageobject><textobject><simpara>The preceding text in the table describes the graphic.</simpara>
</textobject>
</mediaobject>
</figure><para>Most process resources
are accessible to all the threads in the process. Almost all process virtual
memory is shared. A change in shared data by one thread is available to the
other threads in the process. </para>
</sect1><sect1 id="spconcepts-38776"><title>About Monitoring System Performance</title><para>While
your computer is running, counters in the operating system are incremented
to track various system activities. </para><itemizedlist><para>System activities that are tracked are as follows:</para><listitem><para>Central processing unit (CPU) utilization </para>
</listitem><listitem><para>Buffer usage </para>
</listitem><listitem><para>Disk and tape input/output (I/O) activity </para>
</listitem><listitem><para>Terminal device activity </para>
</listitem><listitem><para>System call activity </para>
</listitem><listitem><para>Context switching </para>
</listitem><listitem><para>File access </para>
</listitem><listitem><para>Queue activity </para>
</listitem><listitem><para>Kernel tables </para>
</listitem><listitem><para>Interprocess communication </para>
</listitem><listitem><para>Paging </para>
</listitem><listitem><para>Free memory and swap space </para>
</listitem><listitem><para>Kernel memory allocation (KMA)</para>
</listitem>
</itemizedlist><sect2 id="spconcepts-24"><title>Monitoring Tools</title><para>The Solaris software provides several tools to help you track
how your system is performing. The following table describes these tools. </para><table frame="topbot" id="spconcepts-tbl-25"><title>Performance Monitoring
Tools</title><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="column1" colwidth="103.71*"/><colspec colname="column2" colwidth="139.57*"/><colspec colname="column3" colwidth="115.72*"/><thead><row rowsep="1"><entry><para>Command</para>
</entry><entry><para>Description</para>
</entry><entry><para>For More Information</para>
</entry>
</row>
</thead><tbody><row><entry><para><command>cpustat</command> and <command>cputrack</command> commands</para>
</entry><entry><para>Monitors performance of a system or a process using CPU performance
counters.</para>
</entry><entry><para><olink targetdoc="refman" targetptr="cpustat-1m" remap="external"><citerefentry><refentrytitle>cpustat</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> and <olink targetdoc="refman" targetptr="cputrack-1" remap="external"><citerefentry><refentrytitle>cputrack</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><command>netstat</command> and <command>nfsstat</command> commands</para>
</entry><entry><para>Displays information about network performance</para>
</entry><entry><para><olink targetdoc="refman" targetptr="netstat-1m" remap="external"><citerefentry><refentrytitle>netstat</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> and <olink targetdoc="refman" targetptr="nfsstat-1m" remap="external"><citerefentry><refentrytitle>nfsstat</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><command>ps</command> and <command>prstat</command> commands</para>
</entry><entry><para>Displays information about active processes</para>
</entry><entry><para><olink targetptr="spprocess-59633" remap="internal">Chapter&nbsp;12, Managing System
Processes (Tasks)</olink></para>
</entry>
</row><row><entry><para><command>sar</command> and <command>sadc</command> commands</para>
</entry><entry><para>Collects and reports on system activity data</para>
</entry><entry><para><olink targetptr="spmonitor-24844" remap="internal">Chapter&nbsp;13, Monitoring System
Performance (Tasks)</olink></para>
</entry>
</row><row><entry><para>Sun Enterprise SyMON</para>
</entry><entry><para>Collects system activity data on Sun's enterprise-level systems</para>
</entry><entry><para><citetitle>Sun Enterprise SyMON 2.0.1 Software User's Guide</citetitle></para>
</entry>
</row><row><entry><para><command>swap</command> command</para>
</entry><entry><para>Displays information about available swap space on your system</para>
</entry><entry><para><olink targetdoc="sagdfs" targetptr="fsswap-14677" remap="external">Chapter 21, <citetitle remap="chapter">Configuring Additional Swap Space (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Devices and File Systems</citetitle></olink></para>
</entry>
</row><row><entry><para><command>vmstat</command> and <command>iostat</command> commands</para>
</entry><entry><para>Summarizes system activity data, such as virtual memory statistics,
disk usage, and CPU activity</para>
</entry><entry><para><olink targetptr="spmonitor-24844" remap="internal">Chapter&nbsp;13, Monitoring System
Performance (Tasks)</olink></para>
</entry>
</row><row><entry><para><command>cputrack</command> and <command>cpustat</command> commands</para>
</entry><entry><para>Assists in accessing hardware performance counter facilities provided
by microprocessors</para>
</entry><entry><para><olink targetdoc="refman" targetptr="cputrack-1" remap="external"><citerefentry><refentrytitle>cputrack</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> and <olink targetdoc="refman" targetptr="cpustat-1m" remap="external"><citerefentry><refentrytitle>cpustat</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man pages</para>
</entry>
</row><row><entry><para><command>kstat</command> and <command>mpstat</command> commands</para>
</entry><entry><para>Examines the available kernel  statistics, or  <literal>kstats</literal>,
on the system and reports those statistics which match the criteria specified
on the command line. The <command>mpstat</command> command reports processor
statistics  in  tabular form.</para>
</entry><entry><para><olink targetdoc="refman" targetptr="kstat-1m" remap="external"><citerefentry><refentrytitle>kstat</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> and <olink targetdoc="refman" targetptr="mpstat-1m" remap="external"><citerefentry><refentrytitle>mpstat</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man pages.</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect2>
</sect1>
</chapter>