<chapter id="chapter1-1"><title>Overview of Solaris System Tuning</title><highlights><para>This section provides overview information about the format of the tuning
information in this manual. This section also describes the different ways
to tune a Solaris system.</para><itemizedlist><listitem><para><olink targetptr="fsvdj" remap="internal">What's New in Solaris System Tuning?</olink></para>
</listitem><listitem><para><olink targetptr="chapter1-32" remap="internal">What's New in Solaris System
Tuning in the Solaris 10 Release?</olink></para>
</listitem><listitem><para><olink targetptr="chapter1-2" remap="internal">Tuning a Solaris System</olink></para>
</listitem><listitem><para><olink targetptr="chapter1-3" remap="internal">Tuning Format of Tunable Parameters
Descriptions</olink></para>
</listitem><listitem><para><olink targetptr="chapter1-9" remap="internal">Tuning the Solaris Kernel</olink></para>
</listitem><listitem><para><olink targetptr="chapter1-13" remap="internal">Special Solaris tune and var
Structures</olink></para>
</listitem><listitem><para><olink targetptr="chapter1-28" remap="internal">Viewing Solaris System Configuration
Information</olink></para>
</listitem><listitem><para><olink targetptr="chapter1-25" remap="internal">kstat Utility</olink></para>
</listitem>
</itemizedlist>
</highlights><sect1 id="fsvdj"><title>What's New in Solaris System Tuning?</title><para>This section describes new or changed parameters in this Solaris release.</para><itemizedlist><listitem><para><emphasis role="strong">Solaris Express Developer Edition
1/08</emphasis>: The <literal>nfs4_dynamic</literal> parameter
information was inadvertently included in previous versions. This parameter
is not available.</para>
</listitem><listitem><para><emphasis role="strong">Solaris Express Developer Edition 1/08</emphasis>: The translation storage buffers parameters in
the <olink targetptr="chapter2-94" remap="internal">sun4u or sun4v Specific Parameters</olink> section
are being revised to provide better information. In this release, the following
parameters have changed:</para><itemizedlist><listitem><para><olink targetptr="chapter2-162" remap="internal">enable_tsb_rss_sizing</olink></para>
</listitem><listitem><para><olink targetptr="chapter2-128" remap="internal">tsb_rss_factor</olink></para>
</listitem>
</itemizedlist>
</listitem><listitem><para><emphasis role="strong">Solaris Express Developer
Edition 1/08</emphasis>: The Solaris 10 version of this manual inadvertently
included the <olink targetptr="fsvdh" remap="internal">tcp_keepalive_abort_interval</olink> parameter
information. This parameter is only available in the Solaris Express release.</para>
</listitem><listitem><para><emphasis role="strong">Solaris Express Developer
Edition 9/07</emphasis>: Parameter information was updated to include
sun4v systems. For more information, see the following references:</para><itemizedlist><listitem><para><olink targetptr="chapter2-30" remap="internal">maxphys</olink></para>
</listitem><listitem><para><olink targetptr="chapter2-129" remap="internal">tmpfs:tmpfs_maxkmem</olink></para>
</listitem><listitem><para><olink targetptr="chapter2-94" remap="internal">sun4u or sun4v Specific Parameters</olink></para>
</listitem>
</itemizedlist>
</listitem><listitem><para><emphasis role="strong">Solaris Express Developer
Edition 9/07</emphasis>: The range value for the <literal>maxpgio</literal> parameter
information that was previously published in this book was incorrect. For
more information, see <olink targetptr="chapter2-148" remap="internal">maxpgio</olink>.</para>
</listitem><listitem><para><emphasis role="strong">Solaris Express Developer
Edition 5/07</emphasis>: The IP instances project enables you to configure
a zone as an exclusive-IP zone and assign exclusive access of some LANs or
VLANs to that zone.</para><para>The previous behavior of shared-IP zones remains
the default behavior. The exclusive-IP zone means that all aspects of the
TCP/IP state and policy are per exclusive-IP zone, including TCP/IP tunable
parameters.</para><para>The introduction of the IP instances feature means
that the following TCP parameters can only be set in the global zone because
they require the <literal>PRIV_SYS_NET_CONFIG</literal> privilege:</para><itemizedlist><listitem><para><olink targetptr="chapter4-7" remap="internal">ip_squeue_fanout</olink></para>
</listitem><listitem><para><olink targetptr="chapter4-5" remap="internal">ip_squeue_worker_wait</olink></para>
</listitem><listitem><para><olink targetptr="gbsbo" remap="internal">ip_soft_rings_cnt</olink></para>
</listitem>
</itemizedlist><para>The other TCP, IP, UDP, and SCTP parameters and route metrics only require
the <literal>PRIV_SYS_IP_CONFIG</literal> privilege. Each exclusive-IP zone
controls its own set of these parameters. For shared-IP zones, TCP, IP, UDP,
SCTP, and route parameters are controlled by the global zone since the settings
of these parameters are shared between the global zone and all shared IP zones.</para><para>For more information about using IP instances in Solaris zones, see <olink targetdoc="sysadrm" remap="external"><citetitle remap="book">System Administration Guide: 
Virtualization Using the Solaris Operating System</citetitle></olink>.</para>
</listitem><listitem><para><emphasis role="strong">Solaris Express, Developer's
Edition 2/07</emphasis>: The <literal>ip_squeue_write</literal> parameter information
that was previously published in this book was incorrect and has been removed.</para>
</listitem><listitem><para><emphasis role="strong">Solaris Express, Developer's
Edition 2/07</emphasis>: The default value of the <literal>ncsize</literal> parameter
was incorrectly documented in the Solaris 10 release. For more information,
see <olink targetptr="chapter2-35" remap="internal">ncsize</olink>.</para>
</listitem><listitem><para><emphasis role="strong">Solaris Express, Developer's
Edition 2/07</emphasis>: The default value of the <literal>nfs:nfs3_nra</literal> parameter
was incorrectly documented in the Solaris 10 release. The default value is
4. For more information, see <olink targetptr="chapter3-16" remap="internal">nfs:nfs3_nra</olink>.</para>
</listitem><listitem><para><emphasis role="strong">Solaris Express 2/06</emphasis>: The <literal>ip_squeue_fanout</literal> parameter
has been modified. For more information, see <olink targetptr="chapter4-7" remap="internal">ip_squeue_fanout</olink>and <olink targetptr="gbsbo" remap="internal">ip_soft_rings_cnt</olink>.</para>
</listitem><listitem><para><emphasis role="strong">Solaris Express 12/05</emphasis>: The <literal>ip_multidata_outbound</literal> parameter
has been enhanced. For more information, see <olink targetptr="gbglv" remap="internal">ip_multidata_outbound</olink>.</para>
</listitem><listitem><para><emphasis role="strong">Solaris Express 11/05</emphasis>: The <literal>ip_forward_src_routed</literal> and <literal>ip6_forward_src_routed</literal> parameters have been corrected. The default
value of this parameter since the Solaris 9 release is disabled, not enabled.
For more information, see <olink targetptr="chapter4-25" remap="internal">ip_forward_src_routed
and ip6_forward_src_routed</olink>.</para>
</listitem><listitem><para><emphasis role="strong">Solaris Express 11/05</emphasis>: The UDP parameters have been
corrected. The default values of these parameters changed in the Solaris 10
release and the new default values were previously undocumented. For more
information, see <olink targetptr="chapter4-57" remap="internal">UDP Tunable Parameters</olink>.</para>
</listitem><listitem><para><emphasis role="strong">Solaris Express
10/05</emphasis>: The <literal>md_mirror:md_resync_bufsz</literal> parameter
is changed. The new default value is 1024 blocks. For more information, see <olink targetptr="chapter2-157" remap="internal">md_mirror:md_resync_bufsz</olink>.</para>
</listitem><listitem><para><emphasis role="strong">Solaris Express 6/05</emphasis>:  The default value of the <literal>sq_max_size</literal> parameter was incorrectly documented in the Solaris
10 release. For more information, see <olink targetptr="chapter5-11" remap="internal">sq_max_size</olink>.</para>
</listitem><listitem><para><emphasis role="strong">Solaris
Express 6/05</emphasis>: For information on using the new TCP keepalive parameters,
see <olink targetptr="fsvdh" remap="internal">tcp_keepalive_abort_interval</olink> and <olink targetptr="fsvdg" remap="internal">tcp_keepalive_interval</olink>.</para>
</listitem>
</itemizedlist>
</sect1><sect1 id="chapter1-32"><title>What's New in Solaris System Tuning in the
Solaris 10 Release?</title><para>This section describes new or
changed parameters in the Solaris 10 release.</para><itemizedlist><listitem><para><olink targetptr="faasv" remap="internal">Default Stack Size</olink></para>
</listitem><listitem><para><olink targetptr="chapter1-33" remap="internal">System V IPC Configuration</olink></para>
</listitem><listitem><para><olink targetptr="chapter1-34" remap="internal">NFSv4 Parameters</olink></para>
</listitem><listitem><para><olink targetptr="chapter1-36" remap="internal">New and Changed TCP/IP Parameters</olink></para>
</listitem><listitem><para><olink targetptr="chapter1-37" remap="internal">Translation Storage Buffer
(TSB) Parameters</olink></para>
</listitem><listitem><para><olink targetptr="chapter1-38" remap="internal">SCTP Tunable Parameters</olink></para>
</listitem>
</itemizedlist><sect2 id="faasv"><title>Default Stack Size</title><para>A new parameter, <literal>default_stksize</literal>, specifies the default
stack size of all threads, kernel or user. The <literal>lwp_default_stksize</literal> parameter
is still available, but it does not affect all kernel stacks. If <literal>default_stksize</literal> is set, it overrides <literal>lwp_default_stksize</literal>. For
more information, see <olink targetptr="faawu" remap="internal">default_stksize</olink>.</para>
</sect2><sect2 id="chapter1-33"><title>System V IPC Configuration</title><para>In this Solaris release, all System V IPC facilities are either automatically
configured or can be controlled by resource controls. Facilities that can
be shared are memory, message queues, and semaphores.</para><para>Resource controls allow IPC settings to be made on a per-project or
per-process basis on the local system or in a name service environment.</para><para>In previous Solaris releases, IPC facilities were controlled by kernel
tunables. You had to modify the <filename>/etc/system</filename> file and
reboot the system to change the default values for these facilities.</para><para>Because the IPC facilities are now controlled by resource controls,
their configuration can be modified while the system is running.</para><para>Many applications that previously required system tuning to function
might now run without tuning because of increased defaults and the automatic
allocation of resources.</para><para>The following table identifies the now obsolete IPC tunables and the
possible resource controls that could be used as replacements. An important
distinction between the obsolete IPC tunables and resource controls is that
the IPC tunables were set on a system-wide basis and the resource controls
are set on a per-project or per-process basis.</para><informaltable frame="topbot"><tgroup cols="5" colsep="0" rowsep="0"><colspec colname="colspec0" colwidth="27.96*"/><colspec colname="colspec1" colwidth="28.92*"/><colspec colname="colspec2" colwidth="23.24*"/><colspec colname="colspec3" colwidth="10.43*"/><colspec colname="colspec4" colwidth="9.47*"/><thead><row rowsep="1"><entry><para>Resource Control</para>
</entry><entry><para>Obsolete Tunable</para>
</entry><entry><para>Old Default Value</para>
</entry><entry><para>Maximum Value</para>
</entry><entry><para>New Default Value</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>process.max-msg-qbytes</literal></para>
</entry><entry><para><literal>msgsys:msginfo_msgmnb</literal></para>
</entry><entry><para>4096</para>
</entry><entry><para><literal>ULONG_MAX</literal></para>
</entry><entry><para>65536</para>
</entry>
</row><row><entry><para><literal>process.max-msg-messages</literal></para>
</entry><entry><para><literal>msgsys:msginfo_msgtql</literal></para>
</entry><entry><para>40</para>
</entry><entry><para><literal>UINT_MAX</literal> </para>
</entry><entry><para>8192</para>
</entry>
</row><row><entry><para><literal>process.max-sem-ops</literal> </para>
</entry><entry><para><literal>semsys:seminfo_semopm</literal></para>
</entry><entry><para>10</para>
</entry><entry><para><literal>INT_MAX</literal></para>
</entry><entry><para>512</para>
</entry>
</row><row><entry><para><literal>process.max-sem-nsems</literal></para>
</entry><entry><para><literal>semsys:seminfo_semmsl</literal></para>
</entry><entry><para>25</para>
</entry><entry><para><literal>SHRT_MAX</literal> </para>
</entry><entry><para>512</para>
</entry>
</row><row><entry><para><literal>project.max-shm-memory</literal></para>
</entry><entry><para><literal>shmsys:shminfo_shmmax*</literal></para>
</entry><entry><para>0x800000</para>
</entry><entry><para><literal>UINT64_MAX</literal></para>
</entry><entry><para>1/4 of physical memory</para>
</entry>
</row><row><entry><para> <literal>project.max-shm-ids</literal> </para>
</entry><entry><para><literal>shmsys:shminfo_shmmni</literal></para>
</entry><entry><para>100</para>
</entry><entry><para><literal>2</literal><superscript>24</superscript></para>
</entry><entry><para>128</para>
</entry>
</row><row><entry><para><literal>project.max-msg-ids</literal></para>
</entry><entry><para><literal>msgsys:msginfo_msgmni</literal></para>
</entry><entry><para>50</para>
</entry><entry><para>2<superscript>24</superscript></para>
</entry><entry><para>128</para>
</entry>
</row><row><entry><para><literal>project.max-sem-ids</literal></para>
</entry><entry><para><literal>semsys:seminfo_semmni</literal></para>
</entry><entry><para>10</para>
</entry><entry><para>2<superscript>24</superscript></para>
</entry><entry><para>128</para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable><para>* Note that the <literal>project.max-shm-memory</literal> resource control
limits the total amount of shared memory of one project, whereas previously,
the <literal>shmsys:shminfo_shmmax</literal> parameter limited the size of
a single shared memory segment.</para><para>For more detailed descriptions of the resource controls, see <olink targetdoc="sysadrm" targetptr="rmctrls-4" remap="external"><citetitle remap="section">Available
Resource Controls</citetitle> in <citetitle remap="book">System Administration
Guide:  Virtualization Using the Solaris Operating System</citetitle></olink>.</para><para>Obsolete parameters can still be included in the <filename>/etc/system</filename> file
on a Solaris system. If so, the parameters are used to initialize the default
resource control values as in previous Solaris releases. For more information,
see <olink targetptr="appendixa-6" remap="internal">Parameters That Are Obsolete or Have Been
Removed</olink>. However, using the obsolete parameters is not recommended.</para><para>The following related parameters have been removed. If these parameters
are included in the <filename>/etc/system</filename> file on a Solaris system,
the parameters are commented out.</para><informaltable frame="none"><tgroup cols="2" colsep="0" rowsep="0"><colspec colwidth="50*"/><colspec colwidth="50*"/><tbody><row><entry><para><literal>semsys:seminfo_semmns</literal></para>
</entry><entry><para><literal>semsys:seminfo_semvmx</literal></para>
</entry>
</row><row><entry><para><literal>semsys:seminfo_semmnu</literal></para>
</entry><entry><para><literal>semsys:seminfo_semaem</literal></para>
</entry>
</row><row><entry><para><literal>semsys:seminfo_semume</literal></para>
</entry><entry><para><literal>semsys:seminfo_semusz</literal></para>
</entry>
</row><row><entry><para><literal>semsys:seminfo_semmap</literal></para>
</entry><entry><para><literal>shmsys:shminfo_shmseg</literal></para>
</entry>
</row><row><entry><para><literal>shmsys:shminfo_shmmin</literal></para>
</entry><entry><para><literal>msgsys:msginfo_msgmap</literal></para>
</entry>
</row><row><entry><para><literal>msgsys:msginfo_msgseg</literal></para>
</entry><entry><para><literal>msgsys:msginfo_msgssz</literal></para>
</entry>
</row><row><entry><para><literal>msgsys:msginfo_msgmax</literal></para>
</entry><entry><para></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable><para>For the current list of available resource controls, see <olink targetdoc="refman1m" targetptr="rctladm-1m" remap="external"><citerefentry><refentrytitle>rctladm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink>. For information about configuring
resource controls, see <olink targetdoc="refman4" targetptr="project-4" remap="external"><citerefentry><refentrytitle>project</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink>,
and <olink targetdoc="sysadrm" targetptr="rmctrls-1" remap="external">Chapter 6, <citetitle remap="chapter">Resource Controls (Overview),</citetitle> in <citetitle remap="book">System Administration Guide:  Virtualization Using the Solaris
Operating System</citetitle></olink>.</para>
</sect2><sect2 id="chapter1-34"><title>NFSv4 Parameters</title><para>The following parameters for the NFSv4 protocol are included in this
release:</para><itemizedlist><listitem><para><olink targetptr="chapter3-32" remap="internal">nfs:nfs4_pathconf_disable_cache</olink></para>
</listitem><listitem><para><olink targetptr="chapter3-50" remap="internal">nfs:nfs4_cots_timeo</olink></para>
</listitem><listitem><para><olink targetptr="chapter3-28" remap="internal">nfs:nfs4_do_symlink_cache</olink></para>
</listitem><listitem><para><olink targetptr="chapter3-29" remap="internal">nfs:nfs4_lookup_neg_cache</olink></para>
</listitem><listitem><para><olink targetptr="chapter3-33" remap="internal">nfs:nfs4_max_threads</olink></para>
</listitem><listitem><para><olink targetptr="chapter3-14" remap="internal">nfs:nfs4_nra</olink></para>
</listitem><listitem><para><olink targetptr="chapter3-38" remap="internal">nfs:nfs4_shrinkreaddir</olink></para>
</listitem><listitem><para><olink targetptr="chapter3-37" remap="internal">nfs:nfs4_bsize</olink></para>
</listitem><listitem><para><olink targetptr="chapter3-55" remap="internal">nfs:nfs4_async_clusters</olink></para>
</listitem><listitem><para><olink targetptr="chapter3-73" remap="internal">nfs:nfs4_max_transfer_size</olink></para>
</listitem>
</itemizedlist><para>For information about NFSv4 parameters, see <olink targetptr="chapter3-3" remap="internal">NFS
Module Parameters</olink>.</para>
</sect2><sect2 id="chapter1-36"><title>New
and Changed TCP/IP Parameters</title><para>The following IP parameters have been added in this Solaris release:</para><itemizedlist><listitem><para><olink targetptr="chapter4-5" remap="internal">ip_squeue_worker_wait</olink></para>
</listitem><listitem><para><olink targetptr="chapter4-7" remap="internal">ip_squeue_fanout</olink></para>
</listitem><listitem><para><olink targetptr="chapter4-75" remap="internal">ipcl_conn_hash_size</olink></para>
</listitem>
</itemizedlist><para>The following TCP parameters are new in this Solaris release:</para><itemizedlist><listitem><para><olink targetptr="fahpm" remap="internal">tcp_rst_sent_rate_enabled</olink></para>
</listitem><listitem><para><olink targetptr="fahpq" remap="internal">tcp_rst_sent_rate</olink></para>
</listitem><listitem><para><olink targetptr="fapwd" remap="internal">tcp_mdt_max_pbufs</olink></para>
</listitem>
</itemizedlist><para>The following TCP/IP parameters are obsolete in this Solaris release.</para><itemizedlist><listitem><para><literal>ipc_tcp_conn_hash_size</literal></para>
</listitem><listitem><para><literal>tcp_compression_enabled</literal></para>
</listitem><listitem><para><literal>tcp_conn_hash_size</literal></para>
</listitem><listitem><para><literal>ip_forwarding</literal></para>
</listitem><listitem><para><literal>ip6_forwarding</literal></para>
</listitem><listitem><para><literal>xxx_forwarding</literal></para>
</listitem>
</itemizedlist><sect3 id="eypmk"><title>IP Forwarding Changes</title><para>In this Solaris release, IP forwarding is enabled or disabled by using
the <command>routeadm</command> command or the <command>ifconfig</command> commands
instead of setting the following tunable parameters with the <command>ndd</command> command:</para><itemizedlist><listitem><para><literal>ip_forwarding</literal></para>
</listitem><listitem><para><literal>ip6_forwarding</literal></para>
</listitem><listitem><para><literal>xxx_forwarding</literal></para>
</listitem>
</itemizedlist><para>Using the <command>routeadm</command> command and the  <command>ifconfig</command> command
instead of the <command>ndd</command> command to set IP forwarding provides
the following advantages:</para><itemizedlist><listitem><para>All settings are persistent across reboots</para>
</listitem><listitem><para>The new <command>ifconfig</command> <literal>router</literal> and <literal>-router</literal> commands can be placed in the <filename>/etc/hostname</filename>.<replaceable>interface</replaceable> files, along with other <command>ifconfig</command> commands
that are run when the interface is initially configured.</para>
</listitem>
</itemizedlist><para>To enable IPv4 or IPv6 packet forwarding on all interfaces of a system,
you would use the following commands:</para><screen># <userinput>routeadm -e ipv4-forwarding</userinput></screen><screen># <userinput>routeadm -e ipv6-forwarding</userinput></screen><para>To disable IPv4 or IPv6 packet forwarding on all interfaces of a system,
you would use the following commands:</para><screen># <userinput>routeadm -d ipv4-forwarding</userinput></screen><screen># <userinput>routeadm -d ipv6-forwarding</userinput></screen><para>In previous Solaris releases, you would enable IPv4 or IPv6 packet forwarding
on all interfaces of a system as follows:</para><screen># <userinput>ndd -set /dev/ip ip_forwarding 1</userinput></screen><screen># <userinput>ndd -set /dev/ip ip6_forwarding 1</userinput></screen><para>In previous Solaris releases, you would disable IPv4 or IPv6 packet
forwarding on all interfaces of a system as follows:</para><screen># <userinput>ndd -set /dev/ip ip_forwarding 0</userinput></screen><screen># <userinput>ndd -set /dev/ip ip6_forwarding 0</userinput></screen><para>If you want to enable IP forwarding on a specific IPv4 interface or
IPv6 interface, you would use syntax similar to the following for your interface.
The <literal>bge0</literal> interface is used an as example.</para><screen># <userinput>ifconfig bge0 router</userinput></screen><screen># <userinput>ifconfig bge0 inet6 router</userinput></screen><para>If you want to disable IP forwarding on a specific IPv4 interface or
IPv6 interface, you would use syntax similar to the following for your interface.
The <literal>bge0</literal> interface is used an as example.</para><screen># <userinput>ifconfig bge0 -router</userinput></screen><screen># <userinput>ifconfig bge0 inet6 -router</userinput></screen><para>Previously, IP forwarding was enabled on a specific interface as follows:</para><screen># <userinput>ndd -set /dev/ip bge0:ip_forwarding 1</userinput></screen><screen># <userinput>ndd -set /dev/ip bge0:ip_forwarding 1</userinput></screen><para>Previously, IP forwarding on a specific interface was disabled as follows:</para><screen># <userinput>ndd -set /dev/ip ip_forwarding 0</userinput></screen><screen># <userinput>ndd -set /dev/ip ip6_forwarding 0</userinput></screen><para>If you want any of the preceding <command>routeadm</command> settings
to take effect on the running system, use the following command:</para><screen># <userinput>routeadm -u</userinput></screen><para>For more information, see <olink targetdoc="refman1m" targetptr="routeadm-1m" remap="external"><citerefentry><refentrytitle>routeadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> and <olink targetdoc="refman1m" targetptr="ifconfig-1m" remap="external"><citerefentry><refentrytitle>ifconfig</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink>.</para>
</sect3>
</sect2><sect2 id="chapter1-37" arch="sparc"><title>Translation
Storage Buffer (TSB) Parameters</title><para>New parameters for tuning Translation Storage Buffer (TSB) are included
in this release. For information about TSB parameters, see <olink targetptr="chapter2-94" remap="internal">sun4u or sun4v Specific Parameters</olink>.</para>
</sect2><sect2 id="chapter1-38"><title>SCTP Tunable Parameters</title><para>Stream Control Transmission Protocol (SCTP), a reliable transport protocol
that provides services similar to the services provided by TCP, is provided
in this Solaris release. For more information about SCTP tunable parameters,
see <olink targetptr="chapter4-98" remap="internal">SCTP Tunable Parameters</olink>.</para>
</sect2>
</sect1><sect1 id="chapter1-2"><title>Tuning a Solaris System</title><para>The Solaris OS is a multi-threaded, scalable <trademark class="registered">UNIX</trademark> operating system that runs on SPARC and x86 processors.
It is self-adjusting to system load and demands minimal tuning. In some cases,
however, tuning is necessary. This book provides details about the officially
supported kernel tuning options available for the Solaris OS.</para><para>The Solaris kernel is composed of a core portion, which is always loaded,
and a number of loadable modules that are loaded as references are made to
them. Many variables referred to in the kernel portion of this guide are in
the core portion. However, a few variables are located in loadable modules.</para><para>A key consideration in system tuning is that setting system parameters
(or system variables) is often the least effective action that can be done
to improve performance. Changing the behavior of the application is generally
the most effective tuning aid available. Adding more physical memory and balancing
disk I/O patterns are also useful. In a few rare cases, changing one of the
variables described in this guide will have a substantial effect on system
performance.</para><para>Remember that one system's <filename>/etc/system</filename> settings
might not be applicable, either wholly or in part, to another system's environment.
Carefully consider the values in the file with respect to the environment
in which they will be applied. Make sure that you understand the behavior
of a system before attempting to apply changes to the system variables that
are described here.</para><para>We recommend that you start with an empty <filename>/etc/system</filename> file
when moving to a new Solaris release. As a first step, add only those tunables
that are required by in-house or third-party applications. Any tunables that
involve System V IPC (semaphores, shared memory, and message queues) have
been modified in the Solaris 10 release and should be changed in your environment.
For more information, see <olink targetptr="chapter1-33" remap="internal">System V IPC Configuration</olink>. After baseline testing has been established, evaluate system performance
to determine if additional tunable settings are required.</para><caution><para>The tunable parameters described in this book can and do change
from Solaris release to Solaris release. Publication of these tunable parameters
does not preclude changes to the tunable parameters and their descriptions
without notice.</para>
</caution>
</sect1><sect1 id="chapter1-3"><title>Tuning Format of Tunable Parameters Descriptions</title><para>The format for the description of each tunable parameter is as follows:</para><itemizedlist><listitem><para>Parameter Name</para>
</listitem><listitem><para>Description</para>
</listitem><listitem><para>Data Type</para>
</listitem><listitem><para>Default</para>
</listitem><listitem><para>Range</para>
</listitem><listitem><para>Units</para>
</listitem><listitem><para>Dynamic?</para>
</listitem><listitem><para>Validation</para>
</listitem><listitem><para>Implicit</para>
</listitem><listitem><para>When to Change</para>
</listitem><listitem><para>Zone Configuration</para>
</listitem><listitem><para>Commitment Level</para>
</listitem><listitem><para>Change History</para>
</listitem>
</itemizedlist><variablelist><varlistentry><term><replaceable>Parameter Name</replaceable></term><listitem><para>Is the exact name that is typed in the <filename>/etc/system</filename> file,
or found in the <filename>/etc/default/</filename><replaceable>facility</replaceable> file.</para><para>Most parameters names are of the form <replaceable>parameter</replaceable> where
the parameter name does not contain a colon (<literal>:</literal>). These
names refer to variables in the core portion of the kernel. If the name does
contain a colon, the characters to the left of the colon reference the name
of a loadable module. The name of the parameter within the module consists
of the characters to the right of the colon. For example:</para><screen><replaceable>module_name</replaceable>:<replaceable>variable</replaceable></screen>
</listitem>
</varlistentry><varlistentry><term>Description</term><listitem><para>Briefly describes what the parameter does or controls.</para>
</listitem>
</varlistentry><varlistentry><term>Data Type</term><listitem><para>Indicates the signed or unsigned short integer or long integer
with the following distinctions:</para><itemizedlist><listitem><para>On a system that runs a 32-bit kernel, a long integer is the
same size as an integer. </para>
</listitem><listitem><para>On a system that runs a 64-bit kernel, a long integer is twice
the width in bits as an integer. For example, an unsigned integer = 32 bits,
an unsigned long integer = 64 bits.</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry><varlistentry><term>Units</term><listitem><para>(Optional) Describes the unit type.</para>
</listitem>
</varlistentry><varlistentry><term>Default</term><listitem><para>What the system uses as the default value. </para>
</listitem>
</varlistentry><varlistentry><term>Range</term><listitem><para>Specifies the possible range allowed by system validation
or the bounds of the data type.</para><itemizedlist><listitem><para>MAXINT &ndash; A shorthand description for the maximum value
of a signed integer (2,147,483,647)</para>
</listitem><listitem><para>MAXUINT &ndash; A shorthand description for the maximum value
of an unsigned integer (4,294,967,295)</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry><varlistentry><term>Dynamic?</term><listitem><para>Yes, if the parameter can be changed on a running system with
the <command>mdb</command> or <command>kmdb</command> debugger. No, if the
parameter is a boot time initialization only.</para>
</listitem>
</varlistentry><varlistentry><term>Validation</term><listitem><para>Checks that the system applies to the value of the variable
either as specified in the <filename>/etc/system</filename> file or the default
value, as well as when the validation is applied.</para>
</listitem>
</varlistentry><varlistentry><term>Implicit</term><listitem><para>(Optional) Provides unstated constraints that might exist
on the parameter, especially in relation to other parameters.</para>
</listitem>
</varlistentry><varlistentry><term>When to Change</term><listitem><para>Explains why someone might want to change this value. Includes
error messages or return codes.</para>
</listitem>
</varlistentry><varlistentry><term>Zone Configuration</term><listitem><para>Identifies whether the parameter can be set in a exclusive-IP
zone or must be set in the global zone. None of the parameters can be set
in shared-IP zones.</para>
</listitem>
</varlistentry><varlistentry><term>Commitment Level</term><listitem><para>Identifies the stability of the interface. Many of the parameters
in this manual are still evolving and are classified as unstable. For more
information, see <olink targetdoc="refman5" targetptr="attributes-5" remap="external"><citerefentry><refentrytitle>attributes</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink>.</para>
</listitem>
</varlistentry><varlistentry><term>Change History</term><listitem><para>(Optional) Contains a link to the Change History appendix,
if applicable.</para>
</listitem>
</varlistentry>
</variablelist>
</sect1><sect1 id="chapter1-9"><title>Tuning the Solaris Kernel</title><para>The following table describes the different ways tunable parameters
can be applied.</para><informaltable frame="topbot"><tgroup cols="2" colsep="0" rowsep="0"><colspec colwidth="50*"/><colspec colwidth="50*"/><thead><row rowsep="1"><entry><para>Apply Tunable Parameters in These Ways</para>
</entry><entry><para>For More Information</para>
</entry>
</row>
</thead><tbody><row><entry><para>Modify the <filename>/etc/system</filename> file</para>
</entry><entry><para><olink targetptr="chapter1-10" remap="internal">/etc/system File</olink></para>
</entry>
</row><row><entry><para>Use the kernel debugger (<command>kmdb</command>)</para>
</entry><entry><para><olink targetptr="chapter1-12" remap="internal">kmdb Command</olink></para>
</entry>
</row><row><entry><para>Use the modular debugger (<command>mdb</command>)</para>
</entry><entry><para><olink targetptr="chapter1-21" remap="internal">mdb Command</olink></para>
</entry>
</row><row><entry><para>Use the <command>ndd</command> command to set TCP/IP parameters</para>
</entry><entry><para><olink targetptr="chapter4-1" remap="internal">Chapter&nbsp;4, Internet Protocol Suite
Tunable Parameters</olink></para>
</entry>
</row><row><entry><para>Modify the <filename>/etc/default</filename> files</para>
</entry><entry><para><olink targetptr="chapter5-2" remap="internal">Tuning NCA Parameters</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable><sect2 id="chapter1-10"><title><filename>/etc/system</filename> File</title><para>The <filename>/etc/system</filename> file provides a static mechanism
for adjusting the values of kernel parameters. Values specified in this file
are read at boot time and are applied. Any changes that are made to the file
are not applied to the operating system until the system is rebooted. </para><para>Prior to the Solaris 8 release, <filename>/etc/system</filename> entries
that set the values of parameters were applied in two phases:</para><itemizedlist><listitem><para>The first phase obtains various bootstrap parameters (for
example, <literal>maxusers</literal>) to initialize key system parameters.</para>
</listitem><listitem><para>The second phase calculates the base configuration by using
the bootstrap parameters, and all values specified in the <filename>/etc/system</filename> file
are applied. In the case of the bootstrap parameters, reapplied values replace
the values that are calculated or reset in the initialization phase.</para>
</listitem>
</itemizedlist><para>The second phase sometimes caused confusion to users and administrators
by setting parameters to values that seem to be impermissible or by assigning
values to parameters (for example, <literal>max_nprocs</literal>) that have
a value overridden during the initial configuration.</para><para>Starting in the Solaris 8 release, one pass is made to set all the values
before the configuration parameters are calculated.</para><sect3 id="chapter1-26"><title>Example&mdash;Setting a Parameter in <filename>/etc/system</filename></title><para>The following <filename>/etc/system</filename> entry sets the number
of read-ahead blocks that are read for file systems mounted using NFS version
2 software. </para><screen><userinput>set nfs:nfs_nra=4</userinput></screen>
</sect3><sect3 id="chapter1-27"><title>Recovering From an Incorrect Value</title><para>Make a copy of the <filename>/etc/system</filename> file before modifying
it so that you can easily recover from incorrect value. For example:</para><screen># <userinput>cp</userinput> <userinput>/etc/system /etc/system.good</userinput></screen><para>If a value specified in the <filename>/etc/system</filename> file causes
the system to become unbootable, you can recover with the following command:</para><screen>ok <userinput>boot -a</userinput></screen><para>This command causes the system to ask for the name of various files
used in the boot process. Press the Return key to accept the default values
until the name of the <filename>/etc/system</filename> file is requested.
When the <literal>Name of system file [/etc/system]:</literal> prompt is displayed, type the name of the good <filename>/etc/system</filename> file or <filename>/dev/null</filename>:</para><screen>Name of system file [/etc/system]: <userinput>/etc/system.good</userinput></screen><para>If <filename>/dev/null</filename> is specified, this path causes the
system to attempt to read from <filename>/dev/null</filename> for its configuration information. Because this file is empty,
the system uses the default values. After the system is booted, the <filename>/etc/system</filename> file can be corrected.</para><para>For more information on system recovery, see <olink targetdoc="sysadv1" remap="external"><citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</sect3>
</sect2><sect2 id="chapter1-12"><title><command>kmdb</command> Command</title><para><command>kmdb</command> is a interactive kernel debugger with the same
general syntax as <command>mdb</command>. An advantage of interactive kernel
debugger is that you can set breakpoints. When a breakpoint is reached, you
can examine data or step through the execution of kernel code.</para><para><command>kmdb</command> can be loaded and unloaded on demand. You do
not have to reboot the system to perform interactive kernel debugging, as
was the case with <command>kadb</command>.</para><para>For more information, see <olink targetdoc="refman1" targetptr="kmdb-1" remap="external"><citerefentry><refentrytitle>kmdb</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink>.</para>
</sect2><sect2 id="chapter1-21"><title><command>mdb</command> Command</title><para>Starting with the Solaris 8 release is the modular debugger, <command>mdb</command>,
is unique among Solaris debuggers because it is easily extensible. A programming
API is available that allows compilation of modules to perform desired tasks
within the context of the debugger.</para><para><command>mdb</command> also includes a number of desirable usability
features, including command-line editing, command history, built-in output
pager, syntax checking, and command pipelining. <command>mdb</command> is
the recommended post-mortem debugger for the kernel.</para><para>For more information, see <olink targetdoc="refman1" targetptr="mdb-1" remap="external"><citerefentry><refentrytitle>mdb</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink>.</para><sect3 id="chapter1-24"><title>Example&mdash;Using <command>mdb</command> to
Change a Value</title><para>To change the value of the integer parameter <literal>maxusers</literal> from
495 to 512, do the following:</para><screen># <userinput>mdb -kw</userinput>
Loading modules: [ unix krtld genunix ip logindmux ptm nfs ipc lofs ]
> <userinput>maxusers/D</userinput>
maxusers:
maxusers:       495
> <userinput>maxusers/W 200</userinput>
maxusers:       0x1ef           =       0x200
> <userinput>$q</userinput></screen><para>Replace <literal>maxusers</literal> with the actual address of the item
to be changed, as well as the value the parameter is to be set to.</para><para>For more information on using the modular debugger, see the <citetitle>Solaris
Modular Debugger Guide</citetitle>.</para><para>When using either <command>kmdb</command> or <command>mdb</command> debugger,
the module name prefix is not required. After a module is loaded, its symbols
form a common name space with the core kernel symbols and any other previously
loaded module symbols. </para><para>For example, <literal>ufs:ufs_WRITES</literal> would be accessed as <literal>ufs_WRITES</literal> in each debugger (assuming the UFS module is loaded).
The <literal>ufs:</literal> prefix is required when set in the <filename>/etc/system</filename> file.</para>
</sect3>
</sect2>
</sect1><sect1 id="chapter1-13"><title>Special Solaris <literal>tune</literal> and <literal>var</literal> Structures</title><para>Solaris tunable parameters come in a variety of forms. The <literal>tune</literal> structure
defined in the<filename>/usr/include/sys/tuneable.h</filename> file is the runtime representation of <literal>tune_t_fsflushr</literal>, <literal>tune_t_minarmem</literal>, and <literal>tune_t_flkrec</literal>. After the
kernel is initialized, all references to these variables are found in the
appropriate field of the <literal>tune</literal> structure.</para><para>Various documents (for example, previous versions of <citetitle>Solaris
System Administration Guide, Volume 2</citetitle>) have stated that the proper
way to set parameters in the <literal>tune</literal> structure is to use the
syntax, <literal>tune:</literal><replaceable>field-name</replaceable> where <replaceable>field-name</replaceable> is replaced by the actual parameter name listed above.
This process silently fails. The proper way to set parameters for this structure
at boot time is to initialize the special parameter that corresponds to the
desired field name. The system initialization process then loads these values
into the <literal>tune</literal> structure.</para><para>A second structure into which various tunable parameters are placed
is the <literal>var</literal> structure named <literal>v</literal>. You can
find the definition of a <literal>var</literal> structure in the <filename>/usr/include/sys/var.h</filename> file. The runtime representation
of variables such as <literal>autoup</literal> and <literal>bufhwm</literal> is
stored here.</para><para>Do not change either the <literal>tune</literal> or <literal>v</literal> structure
on a running system. Changing any field in these structures on a running system
might cause the system to panic.</para>
</sect1><sect1 id="chapter1-28"><title>Viewing Solaris System Configuration Information</title><para>Several tools are available to examine system configuration information.
Some tools require superuser privilege. Other tools can be run by a non-privileged
user. Every structure and data item can be examined with the kernel debugger
by using <command>mdb</command> on a running system or by booting under <command>kmdb</command>.</para><para>For more information, see <olink targetdoc="refman1" targetptr="mdb-1" remap="external"><citerefentry><refentrytitle>mdb</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> or <olink targetdoc="refman1m" targetptr="kadb-1m" remap="external"><citerefentry><refentrytitle>kadb</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink>.</para><sect2 id="chapter1-29"><title><command>sysdef</command> Command</title><para>The <command>sysdef</command> command provides the values of System
V IPC settings, STREAMS tunables, process resource limits, and portions of
the <literal>tune</literal> and <literal>v</literal> structures. For example,
the <command>sysdef</command> &ldquo;Tunable Parameters&rdquo; section from
on a 512-Mbyte <trademark>Sun</trademark> <trademark>Ultra</trademark> 80
system is as follows:</para><screen>10387456        maximum memory allowed in buffer cache (bufhwm)
    7930        maximum number of processes (v.v_proc)
      99        maximum global priority in sys class (MAXCLSYSPRI)
    7925        maximum processes per user id (v.v_maxup)
      30        auto update time limit in seconds (NAUTOUP)
      25        page stealing low water mark (GPGSLO)
       5        fsflush run rate (FSFLUSHR)
      25        minimum resident memory for avoiding deadlock (MINARMEM)
      25        minimum swapable memory for avoiding deadlock (MINASMEM)</screen><para>For more information, see <olink targetdoc="refman1m" targetptr="sysdef-1m" remap="external"><citerefentry><refentrytitle>sysdef</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink>.</para>
</sect2>
</sect1><sect1 id="chapter1-25"><title><literal>kstat</literal> Utility</title><para><literal>kstat</literal>s are data structures maintained by various
kernel subsystems and drivers. They provide a mechanism for exporting data
from the kernel to user programs without requiring that the program read kernel
memory or have superuser privilege. For more information, see <olink targetdoc="refman1m" targetptr="kstat-1m" remap="external"><citerefentry><refentrytitle>kstat</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> or <olink targetdoc="refman3e" targetptr="kstat-3kstat" remap="external"><citerefentry><refentrytitle>kstat</refentrytitle><manvolnum>3KSTAT</manvolnum></citerefentry></olink>.</para><note><para><literal>kstat</literal> data structures with <literal>system_pages</literal> name
in the <literal>unix</literal> module do not report statistics for <literal>cachefree</literal>. <literal>cachefree</literal> is not supported, starting in the
Solaris 9 release.</para>
</note>
</sect1>
</chapter>