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

  • Thread starter Thread starter Keithb
  • Start date Start date
K

Keithb

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
 
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.
 
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
 
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?

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
-----------------------------------------
 
Back
Top