How to make a web site stay connected to SQL server even though there are no users

Discussion in 'ASP .Net' started by Keithb, Oct 10, 2006.

  1. Keithb

    Keithb Guest

    A web site uses a SQL Server instance on another box and it takes a long
    time to establish a connection. Is there any way to make the web site stay
    connected to SQL server at all times, even though there are no users?

    Thanks,

    Keith
     
    Keithb, Oct 10, 2006
    #1
    1. Advertisements

  2. Not that I'm aware of. The server will always try to optimize performance
    and that includes dumping connections. Also, you could have problems when
    the application unloads due to user inactivity. If the connection isn't
    closed correctly it could become lost in the pool, ie: technically open but
    unreferenced and not available.

    Are you sure it's the connection that's causing a delay. A lot of users
    mistake the initial load of the application as a delay in establishing a
    connection when it's actually compiling the code first. How well optimized
    is the database code itself? By this I mean are you performing proper
    garbage collection on the various database connections and commands? If you
    don't, you could be leaving resources laying around that are clogging up the
    works.
     
    Mark Fitzpatrick, Oct 10, 2006
    #2
    1. Advertisements

  3. Keithb

    kbrickey Guest

    Thanks for your ideas. In my development environment the sql server instance
    is on the same box as IIS, and the startup time is short. On the deployment
    environment the sql server instance is on a different box and startup time
    is l-o-n-g. However, once a connection is established, the web site itself
    is fairly fast either way. For some reason it seems to take a long time
    connecting.

    Thanks again,

    Keith
     
    kbrickey, Oct 10, 2006
    #3
  4. A web site uses a SQL Server instance on another box and it takes a long
    Use connection pooling with minimum number of threads greater than zero --
    say 5 or 6.


    --
    Happy Hacking,
    Gaurav Vaish | www.mastergaurav.com
    www.edujinionline.com
    http://eduzine.edujinionline.com
    -----------------------------------------
     
    Gaurav Vaish \(www.EdujiniOnline.com\), Oct 10, 2006
    #4
  5. Keithb

    Guest Guest

    Guest, Oct 10, 2006
    #5
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.