In our experiments, it took less than a tenth of a second to connect an application linked directly with the ODBC-ODBC Bridge client on Linux to a Windows data source over a 100 MB Ethernet link, where both machines were on the same LAN. The connection is slightly slower for interpreted languages like Perl or if there is a Driver Manager (like unixODBC) between the application and the ODBC-ODBC Bridge client.
If your connection times are much slower than 1 second, check the following:
Are the client and server machines on the same Local Area Network (LAN)?
Connection times can increase dramatically if they are not. Try pinging a server from the client to find out what return times you get. For example:
ping www.easysoft.com PING easysoft.com (194.131.236.4): 56 data bytes 64 bytes from 194.131.236.4: icmp_seq=0 ttl=255 time=0.6 ms 64 bytes from 194.131.236.4: icmp_seq=1 ttl=255 time=0.1 ms
In this example, the return time is less than 0.6 ms, which is fast. Machines not on the same LAN can have a much greater return time. This results in slower ODBC connection times.
Turn off reverse lookups in the ODBC-ODBC Bridge server. Reverse lookups on an IP address can be quite slow, depending on how the machine is configured to do the lookup. You can do this from the ODBC-ODBC Bridge HTTP server configuration page. Refer to the Configuration chapter in the ODBC-ODBC Bridge User Guide.
Check that tracing is turned off. There are multiple places tracing and logging may be turned on:
odbc.ini
file, any lines starting with Logging = number_greater_than_0
are commented out (use #) or deleted.Trace = yes
or TraceFile = file
or ensure Trace
is set to no
.0
.All of the above default to tracing turned off or require positive action to turn tracing on.
SQLSetConnectAttr(SQL_ATTR_TRACE, SQL_OPT_TRACE_ON)
to check whether your application is turning on ODBC tracing.If after checking the above, you still want faster connection times, try using persistent ODBC connections. For example, odbc_pconnect
in PHP. Persistent connections hold an ODBC connection open for use by multiple subsequent connections.