Time to connect is 20sec !!!!!!

Time to connect is 20sec !!!!!!

am 21.12.2005 12:00:48 von w.gertzen

--Alt-Boundary-25435.3112986
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Mail message body

Hi !

I try to access a MySql Database by using
VisualBasic (VB6) via ODBC

When I wrote a little VB programm to access mySql
and test the program on the same computer were the MySql
server is running, everything is OK and the databse access is
very fast.

The next step was to install the client application on a Win98 computer.
When I start the VB application there, the data access is very slow.
After some test I found out that the client needs more than 10 seconds to
open
the connection.
Also I found out that when I use the ODBC "test" function it needs more
than 10
seconds (sometimes 20sec) to establish a connection.

I test the same client application using a laptop running WinXP Prof. SP1.
On
this laptop the application was also very slow.


Originally my VB application uses following structure:

sub Event()

Dim conn As New ADODB.Connection


conn.CursorLocation = adUseClient
conn.ConnectionString =
"PROVIDER=MSDASQL;dsn=myAdr;uid=myODBC;pwd=xxxx;database=my
Data;"
conn.open

DO the SQL stuff !!!!

conn.close

end sub


I change the structure that I have a global connection object that is
connected
when the form is loaded and closed if the form is unloaded.
That the performes of the mySql access is fast.
But I want to open a connection only when it is needed and want to close
the
connection soon as possible.


So my question is, how the time to establish the connection of about
20sec can be reduced ?
Maybe I have to reconfigure the server (e.g. change the network name)

(Remark: the ODBC debug options were already disabled!)



MySql Information:
-------------------
MySql Version: 4.1.11-max viaTCP/IP
Networkname: localhost
IP: 127.0.0.1

LAN Structure:
--------------
10MBit Hub
1 Laptop running WinXP Home SP2
1 Laptop running WinXP Prof. SP1
1 desktop running Win98 SE



Laptop with MySql-Server:
-------------------------

WinXp Home + SP2
256MB Memory
10MBit Ethernet Connection


Desktop with client application:
--------------------------------
Win98Se
512MB Memory
10MBit Ethernet Connection
MySql ODBC 3.51 Driver (MyODBC-3.51.11-2-win)


Laptop with client application:
--------------------------------
WinXP Prof. SP1
512MB Memory
10MBit Ethernet Connection
MySql ODBC 3.51 Driver (MyODBC-3.51.11-2-win)


Thanks

Wolfgang Gertzen




--Alt-Boundary-25435.3112986--

AW: Time to connect is 20sec !!!!!!

am 21.12.2005 17:33:42 von Michael Haunzwickl

Hi,

I had similiar problems when I was using a Linux MySQL Server with Win =
XP
Clients. I dont know what was the reason, but it took a long time (more =
then
1 minute) to connect. I dont know what solved the problem, but as I =
entered
the client network names into the servers hosts file (/etc/hosts or on
windows /windows/system32/drivers/etc/hosts) it works fine.=20

So, to be clear: I used Win XP Clients with MyODBC and a Linux MySQL =
Server.
It wasn't a problem of the ODBC or the Server ... It was some problem of =
the
names resolution of the server. Try to enter the client names into your
hosts file on the server ... And try it again.=20

Hope this helps
Michael

-----Ursprüngliche Nachricht-----
Von: w.gertzen@t-online.de [mailto:w.gertzen@t-online.de]=20
Gesendet: Mittwoch, 21. Dezember 2005 12:01
An: myodbc@lists.mysql.com
Betreff: Time to connect is 20sec !!!!!!


Hi !

I try to access a MySql Database by using
VisualBasic (VB6) via ODBC

When I wrote a little VB programm to access mySql
and test the program on the same computer were the MySql
server is running, everything is OK and the databse access is very fast.

The next step was to install the client application on a Win98 computer.
When I start the VB application there, the data access is very slow.=20
After some test I found out that the client needs more than 10 seconds =
to=20
open
the connection.
Also I found out that when I use the ODBC "test" function it needs more=20
than 10
seconds (sometimes 20sec) to establish a connection.

I test the same client application using a laptop running WinXP Prof. =
SP1.=20
On
this laptop the application was also very slow.


Originally my VB application uses following structure:

sub Event()

Dim conn As New ADODB.Connection


conn.CursorLocation =3D adUseClient
conn.ConnectionString =
"PROVIDER=3DMSDASQL;dsn=3DmyAdr;uid=3DmyODBC;pwd=3Dxxxx;data base=3Dmy
Data;"
conn.open

DO the SQL stuff !!!!

conn.close

end sub


I change the structure that I have a global connection object that is=20
connected
when the form is loaded and closed if the form is unloaded. That the
performes of the mySql access is fast. But I want to open a connection =
only
when it is needed and want to close=20
the
connection soon as possible.


So my question is, how the time to establish the connection of about=20
20sec can be reduced ?
Maybe I have to reconfigure the server (e.g. change the network name)

(Remark: the ODBC debug options were already disabled!)



MySql Information:
-------------------
MySql Version: 4.1.11-max viaTCP/IP
Networkname: localhost
IP: 127.0.0.1

LAN Structure:
--------------
10MBit Hub
1 Laptop running WinXP Home SP2
1 Laptop running WinXP Prof. SP1
1 desktop running Win98 SE



Laptop with MySql-Server:
-------------------------

WinXp Home + SP2
256MB Memory
10MBit Ethernet Connection


Desktop with client application:
--------------------------------
Win98Se
512MB Memory
10MBit Ethernet Connection
MySql ODBC 3.51 Driver (MyODBC-3.51.11-2-win)


Laptop with client application:
--------------------------------
WinXP Prof. SP1
512MB Memory
10MBit Ethernet Connection
MySql ODBC 3.51 Driver (MyODBC-3.51.11-2-win)


Thanks=20

Wolfgang Gertzen





--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=3Dgcdmo-myodbc@m.gmane.o rg

RE: Time to connect is 20sec !!!!!!

am 21.12.2005 19:17:35 von James Frankman

I've also experienced problems with Reverse DNS lookups. MySQL default =
performs a reverse DNS lookup for each connection request for some =
reason these reverse lookups were taking 30 seconds on our network. I =
had to put skip-name-resolve in the MySQL configuration file and this =
problem went away.

-----Original Message-----
From: w.gertzen@t-online.de [mailto:w.gertzen@t-online.de]
Sent: Wednesday, December 21, 2005 10:13 AM
To: myodbc@lists.mysql.com
Subject: AW: Time to connect is 20sec !!!!!!


Hi,

thanks for the quick response !

I put the client into the hosts file, but the access to the server is =
still very=20
slow.=20

I don't think that is has something to do with the name resolution.

If I stop the server and use the "test" button on the ODBC connector=20
dialog, I directly receive the message that the MySql server can't=20
connected.

Maybe the connection time is so slow because a new server thread must=20
be started and connected to the port?=20
Or is it a problem of the WinXP internal firewall ????

Thanks

Wolfgang



--=20
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: =
http://lists.mysql.com/myodbc?unsub=3Djfrankman@idfbins.com


--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=3Dgcdmo-myodbc@m.gmane.o rg