G
Guest
Okay, here is what's happening:
I have a reasonably fast laptop (1.4 GHz Mobile M, so comparable to 2.5GHz
P4) doing .net development.
Running Windows XP pro, SP2
IIS is installed and running fine
All SQL Servers I am referring to share a small (10 computers or so) LAN
with a 100MB Switch.
No other computers on the LAN exhibit this problem.
The situation is this:
Whenever I start my .net application from scratch (either by
stopping/restarting IIS or recompiling the application dll), the first
SqlConnection "open" statement takes 45 seconds to open the SQL connection.
It is nearly exactly 45 seconds every time, which makes me think it's some
sort of timeout.
The code:
SqlConnection conn = new SqlConnection("user
id=sa;password=thepassword;initial catalog=thecatalog;data
source=THESERVER;Connect Timeout=30");
conn.Open(); // this line takes 45 seconds to execute the first time only
I have been researching this and trying things for two days, so please note
that:
A) I have re-installed .net Framework 1.1 SP1.
B) I have re-installed SQL Server SP3a.
C) I have tried turning pooling on and off deliberately in the connection
string. When I turn pooling off, every subsequent call to this function
takes a long time.
D) I have verified that this super-slow login occurs between this laptop and
each of 3 different SQL Servers: one running server 2003, one running 2000
server, and one running on a XP Pro machine (so it is probably not the SQL
Server machine itself)
E) I have verified that it happens in every .net project (tried 3) that uses
a SqlConnection. (so it's not the particular project settings).
F) I have turned off the QOS packets for the NICs (so it's probably not QOS
packet overhead)
G) I have repeated the problem both connected through a 100MB switch (at
various speeds, from 10MB half duplex through 100MB full) and connected via
802.11b wireless and I have set the ethernet adaptive retry to 40 instead of
1 (so it's probably not collisions).
H) I have disabled 'named pipes' in the SQL Server Network Utility on both
the client and the server.
I) I have tried with another user id in the connection string.
More information:
I can open enterprise manager and connect to any of these SQL Servers in
less than 10 seconds. I can create an ODBC DSN and 'test' it with no
perceivable delay. It is only SqlConnection.Open() that exhibits the
slowness, and it does it EVERY TIME.
The connection strings I've tried:
"user id=sa;password=thepassword;initial catalog=thecatalog;data
source=THESERVER;Connect Timeout=30;Trusted_Connection=False"
(same result)
"user id=sa;password=thepassword;initial catalog=thecatalog;data
source=THESERVER;Connect Timeout=30;Trusted_Connection=True"
(fails because trusted connection doesn't work)
"user id=sa;password=thepassword;initial catalog=thecatalog;data
source=10.0.10.10,1433;DNetwork Library=DBMSSOCN;Connect Timeout=30;"
(same result)
"user id=sa;password=thepassword;initial catalog=thecatalog;data
source=THESERVER;Connect Timeout=30;Pooling=true"
(same result)
"user id=sa;password=thepassword;initial catalog=thecatalog;data
source=THESERVER;Connect Timeout=30;Pooling=false"
(same result, but all calls to open take long time)
"user id=sa;password=thepassword;initial catalog=thecatalog;data
source=THESERVER;Connect Timeout=2"
(same result)
"user id=<anotherID>;password=thepassword;initial catalog=thecatalog;data
source=THESERVER;Connect Timeout=30"
(same result).
As I said, I have researched this on google and MS for over 2 days now and
have tried most things I found there. I would appreciate any suggestions as
long as they don't repeat things I've tried above!
Thanks,
B B
I have a reasonably fast laptop (1.4 GHz Mobile M, so comparable to 2.5GHz
P4) doing .net development.
Running Windows XP pro, SP2
IIS is installed and running fine
All SQL Servers I am referring to share a small (10 computers or so) LAN
with a 100MB Switch.
No other computers on the LAN exhibit this problem.
The situation is this:
Whenever I start my .net application from scratch (either by
stopping/restarting IIS or recompiling the application dll), the first
SqlConnection "open" statement takes 45 seconds to open the SQL connection.
It is nearly exactly 45 seconds every time, which makes me think it's some
sort of timeout.
The code:
SqlConnection conn = new SqlConnection("user
id=sa;password=thepassword;initial catalog=thecatalog;data
source=THESERVER;Connect Timeout=30");
conn.Open(); // this line takes 45 seconds to execute the first time only
I have been researching this and trying things for two days, so please note
that:
A) I have re-installed .net Framework 1.1 SP1.
B) I have re-installed SQL Server SP3a.
C) I have tried turning pooling on and off deliberately in the connection
string. When I turn pooling off, every subsequent call to this function
takes a long time.
D) I have verified that this super-slow login occurs between this laptop and
each of 3 different SQL Servers: one running server 2003, one running 2000
server, and one running on a XP Pro machine (so it is probably not the SQL
Server machine itself)
E) I have verified that it happens in every .net project (tried 3) that uses
a SqlConnection. (so it's not the particular project settings).
F) I have turned off the QOS packets for the NICs (so it's probably not QOS
packet overhead)
G) I have repeated the problem both connected through a 100MB switch (at
various speeds, from 10MB half duplex through 100MB full) and connected via
802.11b wireless and I have set the ethernet adaptive retry to 40 instead of
1 (so it's probably not collisions).
H) I have disabled 'named pipes' in the SQL Server Network Utility on both
the client and the server.
I) I have tried with another user id in the connection string.
More information:
I can open enterprise manager and connect to any of these SQL Servers in
less than 10 seconds. I can create an ODBC DSN and 'test' it with no
perceivable delay. It is only SqlConnection.Open() that exhibits the
slowness, and it does it EVERY TIME.
The connection strings I've tried:
"user id=sa;password=thepassword;initial catalog=thecatalog;data
source=THESERVER;Connect Timeout=30;Trusted_Connection=False"
(same result)
"user id=sa;password=thepassword;initial catalog=thecatalog;data
source=THESERVER;Connect Timeout=30;Trusted_Connection=True"
(fails because trusted connection doesn't work)
"user id=sa;password=thepassword;initial catalog=thecatalog;data
source=10.0.10.10,1433;DNetwork Library=DBMSSOCN;Connect Timeout=30;"
(same result)
"user id=sa;password=thepassword;initial catalog=thecatalog;data
source=THESERVER;Connect Timeout=30;Pooling=true"
(same result)
"user id=sa;password=thepassword;initial catalog=thecatalog;data
source=THESERVER;Connect Timeout=30;Pooling=false"
(same result, but all calls to open take long time)
"user id=sa;password=thepassword;initial catalog=thecatalog;data
source=THESERVER;Connect Timeout=2"
(same result)
"user id=<anotherID>;password=thepassword;initial catalog=thecatalog;data
source=THESERVER;Connect Timeout=30"
(same result).
As I said, I have researched this on google and MS for over 2 days now and
have tried most things I found there. I would appreciate any suggestions as
long as they don't repeat things I've tried above!
Thanks,
B B