Connection Pooling and low use web site

  • Thread starter Thread starter mikemad
  • Start date Start date
M

mikemad

I developed a website for a company. The site is in beta and is
infrequently used. However, when my customer does use it, it is very
slow the first time they access it. After that it's fine. I presume
this is because no one was using it so all the connections have timed
out. This won't be a problem in the future if they get at least one
user a minute.

Is there a setting to keep the last connection alive in a connection
pool so they never get this initial hit. I wrote a small app. to open
the home page every 30 seconds but it seems like there's a better way.
Thanks.

Mike
 
Hi,

Are you sure the connection pooling is bottleneck?
What provider are you using?
 
Well it shouldn't be *very* slow the first time because of connection
pooling. The difference would be only slightly noticeable.
Could it be that the slowness is due to the application being compiled at
the first hit - like an ASP.NET app is?

BTW, run sp_who on your Sql Server and check and see how many connections
has ADO.NET opened and kept in the pool.

If you are damn sure that it is indeed connection pool (which again
shouldn't be *very* slow .. the difference should be in the order of
milliseconds unless your database server is on the other side of the
globe) - then come back .. we'll work it out :)

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik
 
What DBMS? SQL Server? Access? Jet? Oracle?
Try setting the MinPoolSize=4 or so.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
You'll probably find it's the compilation overhead the first time the pages
are accessed rather than the connection pooling

Paul
 
I apologize for not putting more information in here. True, I don't
know for sure that it is connection pooling. Yes, it is an ASP.NET
application with SQL server on the backend using ADO.NET. This is also
on Windows Server 2003. The DB is on the same machine as the Website.
The scenario is like this. I go to the web site the first time, it
takes several seconds for the first page to come up. The first page
does access the database. I close the browser, open a new browser, then
go to the site and it's lightning fast. Next, I wait about 5 minutes
(could be even less, like 1 minute), go to the site, and the first page
is slow again. This happens either at home or work so I don't think
it's a proxy server thing. If it was ASP.NET compiling then I'd only
have this problem once, correct?? I'll try your suggestions with
running sp_who as well as trying to change the minimum connection pool
size. Any more info would be appreciated.

Mike Maddox
 
I agree with Sahil, it's hard to tell where the slowness is coming from, it
may or may not be caused by ADO.NET or ASP.NET.

If you want to keep the pool loaded with active connections, you can use the
"min pool size" connection string option. Set it so something like 5 or so.
That way you can try whether ADO.NET is causing trouble :) If it turns out
that this doesn't help I'd strongly recomend to revert back to its default
(0) so we don't have connections sitting in the pool for long periods of
time.

--
Pablo Castro
Program Manager - ADO.NET Team
Microsoft Corp.

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top