Why does it take so long to connect to the ODBC-ODBC Bridge server?

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:

  1. 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.

  2. 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.

  3. Check that tracing is turned off. There are multiple places tracing and logging may be turned on:

    1. Make sure that in your odbc.ini file, any lines starting with Logging = number_greater_than_0 are commented out (use #) or deleted.
    2. If you're using the unixODBC Driver Manager, remove lines that look like Trace = yes or TraceFile = file or ensure Trace is set to no.
    3. Turn off ODBC-ODBC Bridge server tracing. To check this, use the Configuration page in the Web Administrator (http://server_machine:8890). Set Logging to 0.
    4. On Windows, make sure Driver Manager tracing is turned off. In ODBC Data Source Administrator, use the Tracing tab to do this.

    All of the above default to tracing turned off or require positive action to turn tracing on.

  4. You can make the ODBC-ODBC Bridge server start a new thread or a new process for each connection. By default, the ODBC-ODBC Bridge server starts a new thread. If MultiProcess is turned on in the Web Administrator however, the server starts a new process, which is a lot slower.
  5. Obtaining a license slot adds a small amount of time to a connection (much less than a tenth of a second). However, if your license limits you to a set number of concurrent connections, the ODBC-ODBC Bridge server tries 5 times at 3 second intervals to obtain a license slot before giving up. Use RetryCount and RetryPause to adjust the retry attempts and pause between attempts.
  6. Use 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.