I was performance tuning a customer's production database, so naturally I ran AWR Reports.
Whenever I ran AWR reports I kept getting the event "SQL *Net more data to client" as the second highest wait event (after CPU time). When I googled it, I came across this post on AskTom:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:951335700013
In it, SDU (Session Data Unit) and MTU (Maximum Transmission Unit) are mentioned. What's the relationship between SDU and MTU ?
If you look through the articles on Google, it would seem that they've all just plagiarised each other, with the wrong information. They all incorrectly say SDU should be a multiple of MTU. This lone post on the same AskTom article has the correct info:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:951335700013#67529392482665
The author says that SDU should be a multiple of MSS (Maximum Segment Size of the network protocol in use), and NOT the MTU.
I had to search for a more authoritative source.
I looked towards Oracle Support as the holy grail of Oracle knowledge. Here I found Oracle Support document ID 274483.1 The relationship between MTU (Maximum Transmission Unit) and SDU (Session Data Unit) . It says
"The principle is that the SDU value be a multiple of the MTU."
Now, this may the source of all the wrong information on the internet.
This document attempts to summarize another doc, SQL Net Packet Sizes (SDU & TDU Parameters) Doc ID 44694.1. This second document says:
"...set the SDU size as a multiple of the MSS."
The reason why MSS is used and not MTU, is that the MTU includes two headers, which reduces the amount of data which Oracle NS (Network Substrate) can transmit per TCP packet. Only MSS determines how much data Oracle can transmit via the lower network protocols.
To calculate the MSS:
MSS = MTU - TCP header size - IP header size
For bog-standard TCP over Ethernet:
MTU = 1500 bytes
TCP = 20 bytes
IP = 20 bytes
Thus, the MSS for TCP/IP over Ethernet is 1460.
I confirmed that the customer's network has an MTU of 1500.
Given that for Oracle 10g the maximum for SDU size is 32767, what's the optimal SDU with an MSS of 1460? I've done the simple math, and it's 32120.
That's what we use for the SDU size for a simple Ethernet network.
The results are quite impressive:
Before:
Top 5 Timed Events Avg % Total
~~~~~~~~~~~~~~~~~~ wait Call
Event Waits Time (s) (ms) Time Wait Class
------------------------------ ------------ ----------- ------ ------ ----------
CPU time 1,203 70.5
db file sequential read 140,179 266 2 15.6 User I/O
SQL*Net more data to client 2,669,360 153 0 8.9 Network
control file parallel write 3,755 115 31 6.7 System I/O
db file scattered read 44,471 101 2 5.9 User I/O
After:
Top 5 Timed Events Avg %Total
~~~~~~~~~~~~~~~~~~ wait Call
Event Waits Time (s) (ms) Time Wait Class
------------------------------ ------------ ----------- ------ ------ ----------
CPU time 636 72.4
db file sequential read 81,221 160 2 18.3 User I/O
control file parallel write 3,794 117 31 13.3 System I/O
db file scattered read 22,473 55 2 6.2 User I/O
log file parallel write 3,648 51 14 5.8 System I/O
(Sorry about the formatting, it's like herding cats.)
The "sql net more data to client" wait is eliminated! :)
At first I thought there was something wrong with the AWR Report, maybe the wrong snapshot was chosen, so I double-checked, and ran it for different days. But, it's really gone! :)