Optimizing Connectivity (SQL Server Compact Edition)

SQL Server 2005 Compact Edition enables you to synchronize data between a SQL Server Compact Edition database and a SQL Server database. Because synchronization is performed over TCP/IP, it is supported over various networks and bandwidths.

To optimize performance, you can modify the settings based on the bandwidth of the network connection. The following table shows the bandwidths used by some of the TCP/IP networks supported by SQL Server Compact Edition.

Bandwidth range Network type

High

  • Ethernets or local area networks (LAN)
  • USB connections using ActiveSync (device-only)

Medium

  • Wireless LAN networks

Low

  • Cellular or mobile networks

When data is synchronized over a cellular or mobile network, requests sent to the server—and responses from the server—can time out. This occurs when a low-bandwidth connection requires too much time to transmit the data. Because time-outs will cause synchronization to fail, specify a longer time-out value.

However, if time-outs are not a problem, set shorter time-out values because a delay in response from the server over a high-bandwidth connection is more likely caused by an unresponsive server. Therefore, applications that run on the desktop and connect to the server over a LAN and devices that connect to the server by using an ActiveSync connection should use shorter time-out values.

Applications that connect to the server over various types of networks should detect the network bandwidth and set appropriate time-out values.

Synchronization Time-Out Properties

The following time-out properties of the merge replication and RDA programming objects can be set to optimize synchronization over various network bandwidths.

  • ConnectionRetryTimeout
    Specifies the time, in seconds, to continue to retry sending requests after an established connection has failed.
  • ConnectTimeout
    Specifies the time, in milliseconds, to wait for a connection to the server.
  • ReceiveTimeout
    Specifies the time, in milliseconds, to wait for the response to a server request.
  • SendTimeout
    Specifies the time, in milliseconds, to wait to send a request to the server.

Time-out Optimization

The following table provides recommendations for setting the time-out values, depending on the network bandwidth.

Property High-bandwidth Medium-bandwidth Low-bandwidth Default

ConnectionRetryTimeout (s)

30

60

120

120

ConnectTimeout (ms)

3000

6000

12000

None

ReceiveTimeout (ms)

1000

3000

6000

60000

SendTimeout (ms)

1000

3000

6000

None

See Also

Reference

SqlCeRemoteDataAccess
SqlCeReplication

Concepts

Using Remote Data Access (RDA)
Using Merge Replication

Other Resources

Enhancing Performance (SQL Server Compact Edition)
SQL Server Compact Edition Remote Data Access Programming
SQL Server Compact Edition Replication Programming

Help and Information

Getting SQL Server Compact Edition Assistance