skip to main content
Connection property descriptions : PacketSize
  

Try DataDirect Drivers Now

PacketSize

Purpose

Determines the number of bytes for each database protocol packet that is transferred from the database server to the client machine (Microsoft SQL Server refers to this packet as a network packet).
Adjusting the packet size can improve performance. The optimal value depends on the typical size of data that is inserted, updated, or returned by the application and the environment in which it is running. Typically, larger packet sizes work better for large amounts of data. For example, if an application regularly returns character values that are 10,000 characters in length, using a value of 32 (16 KB) typically results in improved performance.

Valid values

-1 | 0 | x
where:
x
is an integer from 1 to 128 that represents a number of bytes.

Behavior

If set to -1, the driver uses the maximum packet size that the database server accepts.
If set to 0, the driver uses the default packet size configured on the database server.
If set to x, the driver uses a packet size that is calculated using the specified value multiplied by 512.

Notes

*If SSL encryption is enabled using the EncryptionMethod property, any value set for the PacketSize property is ignored.
*If your application sends queries that only retrieve small result sets, you may want to use a packet size that is smaller than the maximum packet size that is configured on the database server. If a result set that contains only one or two rows of data does not completely fill a larger packet, performance will not improve by setting the value to the maximum packet size.

Example

If PacketSize=8, the packet size is set to 8 * 512 bytes (4096 bytes).

Data source method

setPacketSize

Default

-1

Data type

Int

See also

Performance considerations