Re: OBDC connect slow with ASP
Old thread but same problem.
However, to me the problem seems more related to Windows 2003 than MySQL or the ODBC-driver.
We experience this problem since we migrated our websites to a new Windows 2003-server very recently (last week). These websites (ASP) connect to two different database-servers (both MySQL/Linux), as they did before. The old webserver had the Windows 2000 OS.
We never had this problem back then, not with MySQL ODBC 3.51.6/9/10 nor MySQL 3.23/4.1
Also the behaviour of this problem seems pretty consistent. The first connection to the database-server takes 21 seconds every time. This is only just the connect-method of the ADODB-object. The query and data-return are almost instantly, independent of complexity of the query (these responsetimes are more related to hardware-resources and tuning, and not to this connection-problem). Also the webpage is delivered by the server without delay. So we pinpointed the problem down to the webserver building the ADODB-connection with the database.
The next thing is that if the connection is reused within approx. 2 minutes, there's no delay. If idle-time is longer, then is takes 21 seconds again.
So, it seems more like a caching or keepalive-problem in IIS (6) or Windows 2k3.
I noticed that the connection-timeout for websites is set to 120 seconds by default (IIS-manager, websites-properties). Now I'm not an expert on network-traffic and all that stuff, but this seemed a possible/plausible cause. However, setting the connection-timeout to 1200 sec didn't help.
Also, other programs (on the same server) that use the ODBC to write to our database-server don't seem to have this problem (we run a SYSLOG-agent that writes the windows events to the MySQL-database).
More arguments that point in this direction are given all over the Internet. Microsoft has changed a lot of defaults in Windows 2003, regarding TCP/IP and IIS. This is basically a good thing for better security, but annoying because of a lack of transparency and the time-consuming quest for answers (not mentioning the stress when you have customers to serve) .
So for now I'll continue looking for those obscure Windows/IIS-settings.
Any help will of course be much appreciated.