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

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
 
M

Mark Fitzpatrick

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

kbrickey

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
 
G

Gaurav Vaish \(www.EdujiniOnline.com\)

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

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top