Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Persistent connections under IIS?

by Zombie breischl (Initiate)
on Nov 01, 2000 at 00:42 UTC ( #39326=categorized question: print w/replies, xml ) Need Help??
Contributed by Zombie breischl on Nov 01, 2000 at 00:42 UTC
Q&A  > database programming


I'm using DBI under IIS to output a series of database driven forms. The problem is that because each time a form is viewed, submitted or updated I need to reconnect to the database. I can only have 100 connections to the database at a time, so the system tops out around 250 users, which is not enough. Any suggestions would be greatly appreciated.

Answer: Persistent connections under IIS?
contributed by AgentM

Use CGI or DBI (or both) built-in cacheing techniques. Basically, all you do is specify the module to use cacheing and it will do it automatically. This will NOT dramatically increase the number of users able to connect to the database but will certainly help to speed things up and take care of repeated queries (to its best extent). Some options i the modules are also available for tweaking. i hope you're using mod_perl or fastcgi!

Answer: Persistent connections under IIS?
contributed by gregorovius

As far as I know (and I've really looked for this answer in the ActiveState documentation) IIS/Perlscript will not cache any of global data or pre-compiled scripts. Every time you invoke a page it gets compiled and executed again and there's no way to get around this other than resorting to PerlEx, which comes with it's share of obscurities (I, for instance, was unable to make it stop generating http headers in the ASP like embedded perl option, which prevented me from sending cookies, which is an important lack, and PerlEx comes with no source).

The fact that you can't cache globals under IIS/Perlscript is what prevents you from keeping connections alive. Given this I believe that AgentM's is not a real solution to the problem. runrig's suggestion, which relies on a perl wrapper around microsoft persistant objects, seems like the way to go for me.

If your DB tables are small enough, and most of your traffic is read only, I could suggest you putting your tables into hashes and freezing them into the Application object, which is a horrible hack, but can be a lot faster than querying the database. You can see a discussion on this at this node.

Answer: Persistent connections under IIS?
contributed by runrig

According to this ADO caches the connection object so consider DBD::ADO

Answer: Persistent connections under IIS?
contributed by lachoy

Also, check out PerlEx from the friendly ActiveState folks. Like mod_perl for NT (IIS, O'Reilly, Netscape...) -- at least until mod_perl on NT gets full threading capabilities under Apache 2.

Please (register and) log in if you wish to add an answer

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others cooling their heels in the Monastery: (10)
    As of 2019-10-16 14:46 GMT
    Find Nodes?
      Voting Booth?