Slow Database Connection Initiation with ASPX on Local Server

Discussion in 'ASP .Net' started by Nathaniel Sherman, Dec 21, 2004.

  1. 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!
    Nathaniel Sherman, Dec 21, 2004
    #1
    1. Advertising

  2. 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!
    >
    =?Utf-8?B?VGFtcGEgLk5FVCBLb2Rlcg==?=, Dec 21, 2004
    #2
    1. Advertising

  3. 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!
    >
    =?Utf-8?B?VGFtcGEgLk5FVCBLb2Rlcg==?=, Dec 21, 2004
    #3
  4. 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!
    Nathaniel Sherman, Dec 21, 2004
    #4
  5. .... Anybody? :)

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

    "Nathaniel Sherman" <> wrote in message
    news:...
    > 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!
    Nathaniel Sherman, Dec 22, 2004
    #5
  6. Nathaniel Sherman

    mozo

    Joined:
    Sep 18, 2006
    Messages:
    1
    You're not crazy, I'm having the same problem

    I am currently working on an ASP.NET with MYSQL DB backend project on my XP machine as well. I have been trying to resolve the Open method delay. I have been able to reduce it from 11+ seconds to 4 to 6 seconds by turning off my Anti-virus and firewall software local to my machine. I have used ADO.net (driver from MYSQL for .net ADO) and ODBC.net and get the same results. It always resolves around the Open method. I am only returning a single record from my DB connection and still get the same painful delays. It is keeping me from moving forward on my project because of the performance delays. After reading your post I am going to look into issues with my local IIS instance and see if I can find issues there. If you find any solution let me know and I will do the same.

    Darren Richardson
    mozo, Sep 18, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. irfan
    Replies:
    2
    Views:
    506
    tom fredriksen
    Feb 20, 2006
  2. irfan
    Replies:
    1
    Views:
    340
    tom fredriksen
    Mar 21, 2006
  3. damiaotomas

    Matrix initiation

    damiaotomas, Nov 5, 2003, in forum: C++
    Replies:
    0
    Views:
    426
    damiaotomas
    Nov 5, 2003
  4. gert
    Replies:
    9
    Views:
    686
    John W. Kennedy
    Oct 24, 2007
  5. windandwaves

    initiation not working

    windandwaves, Mar 15, 2006, in forum: Javascript
    Replies:
    4
    Views:
    133
    windandwaves
    Mar 15, 2006
Loading...

Share This Page