424,294 Members | 1,898 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,294 IT Pros & Developers. It's quick & easy.

Slow Database Connection Initiation with ASPX on Local Server

P: n/a
Alright, folks, here's the deal...

I'm working on migrating a classic ASP website to an ASP.NET codebase.
At the heart of the site is a MySQL database.

To make sure an "in-process" program doesn't screw up the live site, I
run a local IIS webserver on my XP Pro (AMD XP 2500+, 512MB DDR RAM)
machine, which resides behind an XP ICS gateway on my LAN. I also have a
MySQL server set up locally for development purposes.

Now, I use essentially the same code for database functionality in
ASP.NET that I'm using in the ASP pages -- thanks to the .NET ADODB
wrapper (Note that I am NOT using ADO.NET per se, but that I have tried
and get the results I'll speak of later) Using said code, connections to
both my local DB server and the DB server which resides on my hosting
provider's servers are initiated quite quickly. The code also works
great in ASP.NET form if compiled and run from the hosting provider's
webserver.

Unfortunately, it takes a good 15-20 seconds to run the
ADODB.Connection.Open() method if I try to run the same ASPX page on my
local webserver. Note that this dramatic pause occurs regardless of
server address/name, and does not seem to be directly related to the
success of the function. And it gets better than that -- if I disable
the server computer's connection to my LAN (and thus, the internet as
well) the connections are lightning quick, as they're apparently
supposed to be.

The only possible explanation I can come up with is that it's DNS
related, somehow... Lookups and reverse-lookups getting snagged
somewhere... Though, one wouldn't think that and DNS-related functions
would have to be used in order to process "localhost" or "127.0.0.1"...

In any case, I've been to the end of the 'net and back again (heh)
multiple times looking for a possible solution to this problem. At this
point, I'd even settle for any evidence that anyone else anywhere is
HAVING this problem... At least then I'd no I'm not just losing my mind.

Considering VS.NET has the ability to build to and debug directly from a
remote server using FrontPage extensions, it wouldn't be the absolute
end of the world if that's the only way I could develop ASP.NET web apps
and services... But it would be nice to have some clue as to what's
going on.

If anyone could shed any light on this issue, I'd be eternally grateful.

Thanks in advance.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
If you are still using ADO code within a aspx page...remember to set
aspcompat="true" in the <%@ Page directive

"Nathaniel Sherman" wrote:
Alright, folks, here's the deal...

I'm working on migrating a classic ASP website to an ASP.NET codebase.
At the heart of the site is a MySQL database.

To make sure an "in-process" program doesn't screw up the live site, I
run a local IIS webserver on my XP Pro (AMD XP 2500+, 512MB DDR RAM)
machine, which resides behind an XP ICS gateway on my LAN. I also have a
MySQL server set up locally for development purposes.

Now, I use essentially the same code for database functionality in
ASP.NET that I'm using in the ASP pages -- thanks to the .NET ADODB
wrapper (Note that I am NOT using ADO.NET per se, but that I have tried
and get the results I'll speak of later) Using said code, connections to
both my local DB server and the DB server which resides on my hosting
provider's servers are initiated quite quickly. The code also works
great in ASP.NET form if compiled and run from the hosting provider's
webserver.

Unfortunately, it takes a good 15-20 seconds to run the
ADODB.Connection.Open() method if I try to run the same ASPX page on my
local webserver. Note that this dramatic pause occurs regardless of
server address/name, and does not seem to be directly related to the
success of the function. And it gets better than that -- if I disable
the server computer's connection to my LAN (and thus, the internet as
well) the connections are lightning quick, as they're apparently
supposed to be.

The only possible explanation I can come up with is that it's DNS
related, somehow... Lookups and reverse-lookups getting snagged
somewhere... Though, one wouldn't think that and DNS-related functions
would have to be used in order to process "localhost" or "127.0.0.1"...

In any case, I've been to the end of the 'net and back again (heh)
multiple times looking for a possible solution to this problem. At this
point, I'd even settle for any evidence that anyone else anywhere is
HAVING this problem... At least then I'd no I'm not just losing my mind.

Considering VS.NET has the ability to build to and debug directly from a
remote server using FrontPage extensions, it wouldn't be the absolute
end of the world if that's the only way I could develop ASP.NET web apps
and services... But it would be nice to have some clue as to what's
going on.

If anyone could shed any light on this issue, I'd be eternally grateful.

Thanks in advance.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 19 '05 #2

P: n/a
Well to clarify..ONLY do this if you are still using COM components in your
aspx pages. Otherwise don't do it.

"Nathaniel Sherman" wrote:
Alright, folks, here's the deal...

I'm working on migrating a classic ASP website to an ASP.NET codebase.
At the heart of the site is a MySQL database.

To make sure an "in-process" program doesn't screw up the live site, I
run a local IIS webserver on my XP Pro (AMD XP 2500+, 512MB DDR RAM)
machine, which resides behind an XP ICS gateway on my LAN. I also have a
MySQL server set up locally for development purposes.

Now, I use essentially the same code for database functionality in
ASP.NET that I'm using in the ASP pages -- thanks to the .NET ADODB
wrapper (Note that I am NOT using ADO.NET per se, but that I have tried
and get the results I'll speak of later) Using said code, connections to
both my local DB server and the DB server which resides on my hosting
provider's servers are initiated quite quickly. The code also works
great in ASP.NET form if compiled and run from the hosting provider's
webserver.

Unfortunately, it takes a good 15-20 seconds to run the
ADODB.Connection.Open() method if I try to run the same ASPX page on my
local webserver. Note that this dramatic pause occurs regardless of
server address/name, and does not seem to be directly related to the
success of the function. And it gets better than that -- if I disable
the server computer's connection to my LAN (and thus, the internet as
well) the connections are lightning quick, as they're apparently
supposed to be.

The only possible explanation I can come up with is that it's DNS
related, somehow... Lookups and reverse-lookups getting snagged
somewhere... Though, one wouldn't think that and DNS-related functions
would have to be used in order to process "localhost" or "127.0.0.1"...

In any case, I've been to the end of the 'net and back again (heh)
multiple times looking for a possible solution to this problem. At this
point, I'd even settle for any evidence that anyone else anywhere is
HAVING this problem... At least then I'd no I'm not just losing my mind.

Considering VS.NET has the ability to build to and debug directly from a
remote server using FrontPage extensions, it wouldn't be the absolute
end of the world if that's the only way I could develop ASP.NET web apps
and services... But it would be nice to have some clue as to what's
going on.

If anyone could shed any light on this issue, I'd be eternally grateful.

Thanks in advance.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 19 '05 #3

P: n/a
Well, first off, thanks for the reply... Unfortunately, I'm using the
.NET ADODB interface component (not ADO.NET objects, but the ADODB
component listed in the .NET "references" section) and not the COM
interface.

To clarify my original post (since, after re-reading it myself, I think
it may have been it bit unclear about some things):

1) The problem: the ADODB.Connection.Open() method takes 15-20 seconds
to intitiate a connection to either a local or a remote MySQL database
server. I have done a good deal of tracing and debugging, and nailed
the delay specifically to the Open statement. I have also used MySQL's
".NET Connector" interface, as well as the generic ADO.NET interface --
same results.

2) This problem does not occur making calls to either the local database
or the remote database using the ADODB COM interface from a .ASP page,
whether the page is served from the local IIS server or my hosting
provider's server.

3) This problem does not occur if I upload the VB.NET ASPX project in
question to my hosting provider's webserver and run it from there.

4) With the ASPX page on the local IIS server, I have attempted to
connect to both the local MySQL server on the same machine (via
"localhost", "127.0.0.1", and the NetBIOS computer name) as well as my
database on my hosting provider's servers (via domain name) with same
results.

5) The local server machine is connected to a home LAN, with internet
gateway functionality being performed by an ICS (Internet Connection
Sharing) gateway computer. The XP firewall is also turned on on the
gateway (but not on my server).

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #4

P: n/a
.... Anybody? :-)

---
Nathaniel Sherman
mailto:na*****@shermanmedia.com
Sherman Media Services
http://www.shermanmedia.com

"Nathaniel Sherman" <na*****@shermanmedia.com> wrote in message
news:OR**************@TK2MSFTNGP14.phx.gbl...
Well, first off, thanks for the reply... Unfortunately, I'm using the
NET ADODB interface component (not ADO.NET objects, but the ADODB
component listed in the .NET "references" section) and not the COM
interface.

To clarify my original post (since, after re-reading it myself, I think
it may have been it bit unclear about some things):

1) The problem: the ADODB.Connection.Open() method takes 15-20 seconds
to intitiate a connection to either a local or a remote MySQL database
server. I have done a good deal of tracing and debugging, and nailed
the delay specifically to the Open statement. I have also used MySQL's
".NET Connector" interface, as well as the generic ADO.NET interface --
same results.

2) This problem does not occur making calls to either the local database
or the remote database using the ADODB COM interface from a .ASP page,
whether the page is served from the local IIS server or my hosting
provider's server.

3) This problem does not occur if I upload the VB.NET ASPX project in
question to my hosting provider's webserver and run it from there.

4) With the ASPX page on the local IIS server, I have attempted to
connect to both the local MySQL server on the same machine (via
"localhost", "127.0.0.1", and the NetBIOS computer name) as well as my
database on my hosting provider's servers (via domain name) with same
results.

5) The local server machine is connected to a home LAN, with internet
gateway functionality being performed by an ICS (Internet Connection
Sharing) gateway computer. The XP firewall is also turned on on the
gateway (but not on my server).

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.