Databases Reference
In-Depth Information
Configuring Packet Size
Remember that larger packet sizes typically provide the best performance
because fewer packets are needed to retrieve data, and fewer packets means fewer
network round trips to and from the database. Therefore, it's important to use a
database driver that allows you to configure the packet size of database protocol
packets. See the section, “Runtime Performance Tuning Options,” page 62, for
more information about performance tuning options to look for in a database
driver. In addition, many database servers can be configured to use packet sizes
that are larger than the default.
If network packets are really the way that data is transported over the net-
work and the MTU of the network controls the size of network packets, why does
a larger database protocol packet size improve performance? Let's compare the
following examples. In both examples, a database driver sends 25KB of data to
the database server, but Example B uses a larger database protocol packet size
than Example A. Because a larger database protocol packet size is used, the num-
ber of network round trips is reduced. More importantly, actual network traffic
is reduced.
Example A: Database Protocol Packet Size = 4KB
Using a 4KB database protocol packet, as shown in Figure 4-11, the
database driver creates seven 4KB database protocol packets (assuming
a 30-byte packet header) to send 25KB of data to the database server (6
packets transporting 3.971KB of data and 1 packet transporting
0.199KB of data).
+ 25KB (7 Database
Protocol Packets)
+
+
+
+
+
+
Figure 4-11
4KB database protocol packet size
If the MTU of the network path is 1500 bytes, as shown in Figure 4-12,
the database protocol packets are divided into network packets for
transport across the network (total of 19 network packets). The first 6
database protocol packets are each divided into three 1500-byte net-
work packets. The data contained in the last database protocol packet
fits within one 1500-byte network packet.
 
Search WWH ::




Custom Search