Connection Pooling and other tips...

Results 1 to 5 of 5

Thread: Connection Pooling and other tips...

  1. #1
    John Harvey Guest

    Default Connection Pooling and other tips...

    Hi,<BR> I have been developing in ASP for 6 months now, and the webs I have created are considerably more stable than many of the other webs we host which rely on PERL. We are having some major problems with ActivePERL and with PERLex. I have been asked to look into what advantages there would be in moving our web to ASP, and rewriting most of the main pages to ASP and eliminating the PERL scripts which run.<BR> The question I&#039d like to ask is how can I optimize IIS for ASP. I have read about increasing the threads for ASP, and I understand there are other optimizations that can be achieved by connection pooling. What exactly is connection pooling, and are there any other ideas you guys know of to optimize the server for ASP. (We run a dual Pentium III 500 with 256MB Ram, on a 20 GB SCSI RAID).<BR>Thanks in advance,<BR>John Harvey

  2. #2
    Sam Otto Guest

    Default RE: Connection Pooling and other tips...

    ODBC drivers (version 3.0 and higher) pool their DB connections internally so every time you request a new connection, you don&#039t actually have to connect to the DB (you just get a previous connection if there is one available).<BR><BR>As far as more performance stuff, from what I&#039ve read, besides the two you mentioned they are all just good programming rules:<BR>1) Minimize your queries<BR>2) If you get a value out of a record set (or any collection) multiple times, get it out once into a variable and use the variable from then on.<BR>3) Use Response.buffer=true<BR>4) Avoid ReDimming arrays<BR>5) Don&#039t keep Objects in your Session Object<BR>6) Batch Response.write stmts (try to minimze intermixing HTML and VB)

  3. #3
    Join Date
    Dec 1969
    Posts
    1,671

    Default RE: Connection Pooling and other tips...

    Thank you thank you thank you..<BR><BR>I was perusing the performance pages here in a desperate attempt to find out why Netscape returned database lookups soo sloow.<BR><BR>3) Use Response.Buffer=true<BR><BR>Yes, do this. I don&#039t know why this works so much better (does the cursor reside on the client side by default?). I was having positively horrid performance, only under Netscape though.<BR><BR>Wow, using this improved the speed of the lookups 100 fold at least; it&#039s nearly instantaneous now. This has been bugging me for a long time.<BR><BR>On the bright side, at least I was already doing the other 5 :)<BR><BR>Thanks again,<BR><BR>Mike

  4. #4
    Sam Otto Guest

    Default RE: Connection Pooling and other tips...

    100 fold!<BR><BR>Man, all response.buffer does is wait til the server is complete done with the page and then send it to the client instead of sending a bunch of little pieces. If you place response.flush in your code it will send everything it has written up to that point.<BR><BR>Here&#039s another trick:<BR><BR>If your returning a large table (say 500+ rows) try breaking it up into multiple tables, repeating the header. For example<BR>count = 1<BR>rs.open ...<BR>while not rs.eof<BR> &#039 write your row of info here<BR> &#039 if you&#039ve written 300 rows, close that table and start another table<BR> if count mod 300 = 0 then<BR> Response.write("&#060;/table>&#060;table>")<BR> end if<BR> count = count + 1<BR> rs.MoveNext<BR>wend<BR><BR>If you don&#039t do this the user will have to wait for that whole table to be rendered before he sees everything...<BR>


  5. #5
    Join Date
    Dec 1969
    Posts
    196

    Default RE: Connection Pooling and other tips...

    You can also speed up a large recordset by using a For..Next loop instead of RS.EOF. The EOF has to be checked after each record.<BR>Example:<BR>For i = 0 to RS.Recordcount<BR>&#060;Table>&#060;/TABLE><BR>RS.MoveNext<BR>Loop<BR>I have used this it increased the speed by 30%<BR>Good Luck

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •