Oracle databases are often shared across geographical areas, so it's imperative
that the Oracle professional understand how database performance is affected by
network communications. The Transparent Network Substrate (TNS), provided by
Oracle, allows distributed communications between databases. It's the tnsnames.ora file
that governs the TNS.
The SDU and TDU parameters in the
tnsnames.ora file
The session data unit (SDU) and transport date unit (TDU)
parameters are located in the tnsnames.ora and
listener.ora files. In the
tnsnames.ora,
SDU specifies the size of the
packets to send over the network. Ideally, SDU should
not surpass the size of the maximum transmission unit (MTU).
MTU is a fixed value that depends on the actual network
implementation used. Oracle recommends that SDU be set
equal to MTU.
The TDU is the default packet size used in the
tnsnames.ora file to group data together. The TDU
parameter should ideally be a multiple of the SDU
parameter. The default value for both SDU and TDU is
2,048, and the maximum value is 32,767 bytes.
The following guidelines apply to SDU and TDU for the
tnsnames.ora:
- The SDU should never be set greater than TDU
because you'll waste network resources by shipping
wasted space in each packet.
- If your users are connecting via modem lines,
you may want to set SDU and TDU in tnsnames.ora to
smaller values because of the frequent resends that
occur over modem lines.
- On fast network connections (T1 or T3 lines),
you should set SDU and TDU equal to the MTU for your
network in tnsnames.ora. On standard Ethernet
networks, the default MTU size is set to 1,514
bytes. On standard token ring networks, the default
MTU size is 4,202.
- If the Multi-Threaded Server (Shared
Servers, or MTS) must be used, you
must also set the mts_dispatchers with the
proper MTU TDU configuration in tnsnames.ora.
- For Streams
replication and for using Oracle in a WAN
environment, Oracle recommends that you increase the
SDU to 32k. Also, the Oracle docs note:
To take
advantage of an increased SDU for Streams
propagation, the receiving side sqlnet.ora
file must include the DEFAULT_SDU_SIZE
parameter. The receiving side listener.ora
file must indicate the SDU change for the
system identifier (SID). The sending side
tnsnames.ora file connect string must also
include the SDU modification for the
particular service.
For Streams, the SEND_BUF_SIZE and
RECV_BUF_SIZE parameters in the listener.ora
file increase the performance of propagation
on your system. Oracle internal
testing of Oracle Data Guard on a WAN has
demonstrated that the maximum setting of 32K
(32768) performs best on a WAN. The primary
gain in performance when setting the SDU is
a result of the reduced number of calls to
packet the data.
In addition to setting the SDU parameter,
network throughput can often be
substantially improved by using the
SQLNET.SEND_BUF_SIZE and
SQLNET.RECV_BUF_SIZE Oracle Net parameters
to increase the size of the network TCP send
and receive I/O buffers.
The SDU and TDU settings are a direct function of the
connection speed between the hosts. For fast T1 lines,
set SDU=TDU=MTU. For slower modem lines, experiment with
smaller values of SDU and TDU.
Scripts for measuring changes to the tnsnames.ora can
be found in the
Oracle script collection.