<chapter id="chapter5-1"><title>Network Cache and Accelerator Tunable Parameters</title><highlights><para>This chapter describes some of the Network Cache and Accelerator (NCA)
tunable parameters.</para><itemizedlist><listitem><para><olink targetptr="chapter5-3" remap="internal">nca:nca_conn_hash_size</olink></para>
</listitem><listitem><para><olink targetptr="chapter5-4" remap="internal">nca:nca_conn_req_max_q</olink></para>
</listitem><listitem><para><olink targetptr="chapter5-5" remap="internal">nca:nca_conn_req_max_q0</olink></para>
</listitem><listitem><para><olink targetptr="chapter5-6" remap="internal">nca:nca_ppmax</olink></para>
</listitem><listitem><para><olink targetptr="chapter5-7" remap="internal">nca:nca_vpmax</olink></para>
</listitem><listitem><para><olink targetptr="chapter5-11" remap="internal">sq_max_size</olink></para>
</listitem><listitem><para><olink targetptr="chapter5-10" remap="internal">ge:ge_intr_mode</olink></para>
</listitem>
</itemizedlist>
</highlights><sect1 id="chapter5-9"><title>Where to Find Tunable Parameters Information</title><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>Tunable Parameter</para>
</entry><entry><para>For Information</para>
</entry>
</row>
</thead><tbody><row><entry><para>Solaris kernel tunables</para>
</entry><entry><para><olink targetptr="chapter2-1" remap="internal">Chapter&nbsp;2, Solaris Kernel Tunable
Parameters</olink></para>
</entry>
</row><row><entry><para>NFS tunable parameters</para>
</entry><entry><para><olink targetptr="chapter3-1" remap="internal">Chapter&nbsp;3, NFS Tunable Parameters</olink></para>
</entry>
</row><row><entry><para>Internet Protocol Suite tunable parameters</para>
</entry><entry><para><olink targetptr="chapter4-1" remap="internal">Chapter&nbsp;4, Internet Protocol Suite
Tunable Parameters</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="chapter5-2"><title>Tuning NCA Parameters</title><para>Setting these parameters is appropriate on a system that is a dedicated
web server. These parameters allocate more memory for caching pages. You can
set all of the tuning parameters described in this chapter in the <filename>/etc/system</filename> file.</para><para>For information on adding tunable parameters to the <filename>/etc/system</filename> file,
see <olink targetptr="chapter1-9" remap="internal">Tuning the Solaris Kernel</olink>.</para><sect2 id="chapter5-3"><title><literal>nca:nca_conn_hash_size</literal></title><variablelist><varlistentry><term>Description</term><listitem><para>Controls the hash table size in the NCA module for all TCP connections,
adjusted to the nearest prime number.</para>
</listitem>
</varlistentry><varlistentry><term>Default</term><listitem><para>383 hash table entries</para>
</listitem>
</varlistentry><varlistentry><term>Range</term><listitem><para>0 to 201,326,557</para>
</listitem>
</varlistentry><varlistentry><term>Dynamic?</term><listitem><para>No</para>
</listitem>
</varlistentry><varlistentry><term>When to Change</term><listitem><para>When the NCA's TCP hash table is too small to keep track of
the incoming TCP connections. This situation causes many TCP connections to
be grouped together in the same hashtable entry. This situation is indicated
when NCA is receiving many TCP connections, and system performance decreases.</para>
</listitem>
</varlistentry><varlistentry><term>Commitment Level</term><listitem><para>Unstable</para>
</listitem>
</varlistentry>
</variablelist>
</sect2><sect2 id="chapter5-4"><title><literal>nca:nca_conn_req_max_q</literal></title><variablelist><varlistentry><term>Description</term><listitem><para>Defines the maximum number of pending TCP connections for NCA
to listen on.</para>
</listitem>
</varlistentry><varlistentry><term>Default</term><listitem><para>256 connections</para>
</listitem>
</varlistentry><varlistentry><term>Range</term><listitem><para>0 to 4,294,967,295</para>
</listitem>
</varlistentry><varlistentry><term>Dynamic?</term><listitem><para>No</para>
</listitem>
</varlistentry><varlistentry><term>When to Change</term><listitem><para>When NCA closes a connection immediately after it is established
because it already has too many established TCP connections.  If NCA is receiving
many TCP connections and can handle a larger load, but is refusing any more
connections, increase this parameter. Doing so allows NCA to handle more simultaneous
TCP connections.</para>
</listitem>
</varlistentry><varlistentry><term>Commitment Level</term><listitem><para>Unstable</para>
</listitem>
</varlistentry>
</variablelist>
</sect2><sect2 id="chapter5-5"><title><literal>nca:nca_conn_req_max_q0</literal></title><variablelist><varlistentry><term>Description</term><listitem><para>Defines the maximum number of incomplete (three-way handshake
not yet finished) pending TCP connections for NCA to listen on.</para>
</listitem>
</varlistentry><varlistentry><term>Default</term><listitem><para>1024 connections</para>
</listitem>
</varlistentry><varlistentry><term>Range</term><listitem><para>0 to 4,294,967,295</para>
</listitem>
</varlistentry><varlistentry><term>Dynamic?</term><listitem><para>No</para>
</listitem>
</varlistentry><varlistentry><term>When to Change</term><listitem><para>When NCA refuses to accept any more TCP connections  because
it already has too many pending TCP connections.  If NCA is receiving many
TCP connections and can handle a larger load, but is refusing any more connections,
increase this parameter. Doing so allows NCA to handle more simultaneous TCP
connections.</para>
</listitem>
</varlistentry><varlistentry><term>Commitment Level</term><listitem><para>Unstable</para>
</listitem>
</varlistentry>
</variablelist>
</sect2><sect2 id="chapter5-6"><title><literal>nca:nca_ppmax</literal></title><variablelist><varlistentry><term>Description</term><listitem><para>Specifies the maximum amount of physical memory (in pages) used
by NCA for caching the pages. This value should not be more than 75 percent
of total memory.</para>
</listitem>
</varlistentry><varlistentry><term>Default</term><listitem><para>25 percent of physical memory</para>
</listitem>
</varlistentry><varlistentry><term>Range</term><listitem><para>1 percent to maximum amount of physical memory</para>
</listitem>
</varlistentry><varlistentry><term>Dynamic?</term><listitem><para>No</para>
</listitem>
</varlistentry><varlistentry><term>When to Change</term><listitem><para>When using NCA on a system with more than 512 Mbytes of memory.
If a system has a lot of physical memory that is not being used, increase
this parameter. Then, NCA will efficiently use this memory to cache new objects.
As a result, system performance will increase.</para><para>This parameter should be increased in conjunction with <literal>nca_vpmax</literal>,
unless you have a system with more physical memory than virtual memory (a
32-bit kernel that has greater than 4 Gbytes memory). Use <olink targetdoc="refman1" targetptr="pagesize-1" remap="external"><citerefentry><refentrytitle>pagesize</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> to determine your system's
page size.</para>
</listitem>
</varlistentry><varlistentry><term>Commitment Level</term><listitem><para>Unstable</para>
</listitem>
</varlistentry>
</variablelist>
</sect2><sect2 id="chapter5-7"><title><literal>nca:nca_vpmax</literal></title><variablelist><varlistentry><term>Description</term><listitem><para>Specifies the maximum amount of virtual memory (in pages) used
by NCA for caching pages. This value should not be more than 75 percent of
the total memory.</para>
</listitem>
</varlistentry><varlistentry><term>Default</term><listitem><para>25 percent of virtual memory</para>
</listitem>
</varlistentry><varlistentry><term>Range</term><listitem><para>1 percent to maximum amount of virtual memory</para>
</listitem>
</varlistentry><varlistentry><term>Dynamic?</term><listitem><para>No</para>
</listitem>
</varlistentry><varlistentry><term>When to Change</term><listitem><para>When using NCA on a system with more than 512 Mbytes of memory.
If a system has a lot of virtual memory that is not being used, increase this
parameter. Then, NCA will efficiently use this memory to cache new objects.
As a result, system performance will increase.</para><para>This parameter should be increased in conjunction with <literal>nca_ppmax</literal>.
Set this parameter about the same value as <literal>nca_vpmax</literal>, unless
you have a system 	with more physical memory than virtual memory.</para>
</listitem>
</varlistentry><varlistentry><term>Commitment Level</term><listitem><para>Unstable</para>
</listitem>
</varlistentry>
</variablelist>
</sect2>
</sect1><sect1 id="chapter5-8"><title>General System Tuning for the NCA</title><para>In addition to setting the NCA parameters, you can do some general system
tuning to benefit NCA performance. If you are using gigabit Ethernet (<literal>ge</literal> driver), you should set the interface in interrupt mode for better
results.</para><para>For example, a system with 4 Gbytes of memory that is booted under 64-bit
kernel should have the following parameters set in the <filename>/etc/system</filename> file.
Use <command>pagesize</command> to determine your system's page size.</para><screen>set sq_max_size=0
set ge:ge_intr_mode=1
set nca:nca_conn_hash_size=82500
set nca:nca_conn_req_max_q=100000
set nca:nca_conn_req_max_q0=100000
set nca:nca_ppmax=393216
set nca:nca_vpmax=393216</screen><sect2 id="chapter5-11"><title><literal>sq_max_size</literal></title><variablelist><varlistentry><term>Description</term><listitem><para>Sets the depth of the syncq (number of messages) before a destination
STREAMS queue generates a <literal>QFULL</literal> message.</para>
</listitem>
</varlistentry><varlistentry><term>Default</term><listitem><para>10000 messages</para>
</listitem>
</varlistentry><varlistentry><term>Range</term><listitem><para>0 (unlimited) to MAXINT</para>
</listitem>
</varlistentry><varlistentry><term>Dynamic?</term><listitem><para>No</para>
</listitem>
</varlistentry><varlistentry><term>When to Change</term><listitem><para>When NCA is running on a system with a lot of memory, increase
this parameter to allow drivers to queue more packets of data. If a server
is under heavy load, increase this  parameter so that modules and drivers
can process more data without dropping packets or getting backlogged.</para><para><emphasis role="strong">Solaris 8 and later releases</emphasis> &ndash;
Do not set this parameter to 0 on production systems. If you need to change
this parameter, gradually increase this value, and monitor the system.</para><para><emphasis role="strong">Solaris 7 and earlier releases</emphasis> &ndash;
Do not set this parameter to 0 on production systems. If you need to change
this parameter, gradually increase this value to a maximum of 100, and monitor
the system.</para>
</listitem>
</varlistentry><varlistentry><term>Commitment Level</term><listitem><para>Unstable</para>
</listitem>
</varlistentry><varlistentry><term>Change History</term><listitem><para>For information, see <olink targetptr="appendixa-45" remap="internal">sq_max_size
(Solaris 9 12/02 Release)</olink>.</para>
</listitem>
</varlistentry>
</variablelist>
</sect2><sect2 id="chapter5-10"><title><literal>ge:ge_intr_mode</literal></title><variablelist><varlistentry><term>Description</term><listitem><para>Enables the <literal>ge</literal> driver to send packets directly
to the upper communication layers rather than queue the packets</para>
</listitem>
</varlistentry><varlistentry><term>Default</term><listitem><para>0 (queue packets to upper layers)</para>
</listitem>
</varlistentry><varlistentry><term>Range</term><listitem><para>0 (enable) or 1 (disable)</para>
</listitem>
</varlistentry><varlistentry><term>Dynamic?</term><listitem><para>No</para>
</listitem>
</varlistentry><varlistentry><term>When to Change</term><listitem><para>When NCA is enabled, set this parameter to 1 so that the packet
is delivered to NCA in interrupt mode for faster processing.</para>
</listitem>
</varlistentry><varlistentry><term>Commitment Level</term><listitem><para>Unstable</para>
</listitem>
</varlistentry>
</variablelist>
</sect2>
</sect1>
</chapter>