OPINION time... on Sql Connections

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Re: OPINION time... on Sql Connections

    Hi,

    Let’s say that you have really busy server that serve 500 request per
    second. If you keep connection for every user you will end up with 500
    open connections to the DB. Holding connections to the DB result in
    operation and data allocation on the DB that will cause the DB to
    produce poor performance.

    The best practice is to hold the connection as short as possible
    particular when the CLR maintain connection pooling for you.

    Natty Gur, CTO
    Dao2Com Ltd.
    28th Baruch Hirsch st. Bnei-Brak
    Israel , 51114

    Phone Numbers:
    Office: +972-(0)3-5786668
    Fax: +972-(0)3-5703475
    Mobile: +972-(0)58-888377

    Know the overall picture


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Natty Gur Guest

  2. Similar Questions and Discussions

    1. Opinion
      I need some opinions. Here is the situation: I have a DataGrid with TemplateColumns. To display my values, I use the ASP code in the HTML. So...
    2. Losing HTTP connections over time
      Hi, Im making repeated asynchronous calls (up to 100,000) to a web service from a windows service, in a loop. I have increased the ServicePoint's...
    3. Please share your opinion with me.
      I am sorry for posting this message again. But I really want to hear more responses. --- My company is designing a new ASP.Net web application....
    4. Opinion which to get?
      I'm considering getting a Mac for my I.T company. I currently have a PC notebook but the display starting going after 2 months of use. It was...
    5. your opinion
      Hey I just wanted to get some opinion's on this site I building right now. I through it up on a free brinkster.com server for testing. just...
  3. #2

    Default RE: OPINION time... on Sql Connections

    Hello David,

    Your solution is not scaleable. If there are over 1000 users visiting the
    page, then there will be 1000 dababase connections simultaneously, which is
    unacceptable. Database connections represent a critical, expensive, and
    limited resource, particularly in a multi-tier Web application. It is
    imperative that you manage your connections correctly because your approach
    can significantly affect the overall scalability of your application.

    For DB connections in web application, we need to open database connections
    late, and close them early. The scalability of an application is
    controlled by database connection pooling, because a limited number of
    database connections can service a much larger number of clients. Database
    connection pooling enables an application to reuse an existing connection
    from a pool, instead of repeatedly establishing a new connection with the
    database. This technique also improves performance, because the significant
    time required to establish a new connection can be avoided.

    I suggest you refer to MSDN topic ".NET Data Access Architecture Guide" for
    details.
    [url]http://msdn.microsoft.com/architecture/application/default.aspx?pull=/librar[/url]
    y/en-us/dnbda/html/daag.asp

    Hope it helps.

    Best regards,
    yhhuang
    VS.NET, Visual C++
    Microsoft

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Got .Net? [url]http://www.gotdotnet.com[/url]
    --------------------
    !From: "David Waz..." <dlw@pickpro.com>
    !Newsgroups: microsoft.public.dotnet.framework.aspnet
    !Subject: OPINION time... on Sql Connections
    !Lines: 16
    !X-Priority: 3
    !X-MSMail-Priority: Normal
    !X-Newsreader: Microsoft Outlook Express 6.00.3790.0
    !X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    !Message-ID: <PclNa.871$6i6.414@newssvr23.news.prodigy.com>
    !NNTP-Posting-Host: 65.23.4.76
    !X-Complaints-To: [email]abuse@prodigy.net[/email]
    !X-Trace: newssvr23.news.prodigy.com 1057349551 ST000 65.23.4.76 (Fri, 04
    Jul 2003 16:12:31 EDT)
    !NNTP-Posting-Date: Fri, 04 Jul 2003 16:12:31 EDT
    !Organization: Prodigy Internet [url]http://www.prodigy.com[/url]
    !X-UserInfo1:
    FKPO@MC@@S@[R]LY]JM\_TLA^R_FBL@MAHU^_BAMEH]TCDYG^WH[AACY@TZZXQ[KS^ESKCJLOF_J
    _NGAWNTG^_XGTNTAHULK[X[NRTC@G\P^PLT_OCBRHUO@@TBQZDZMHD[YZ@NLXQXIWMOSXT_KOLK^
    ^CXFF\WHMI^C@EGA_[FXAQ@E^TGNMUXGYNS[QQVL
    !Date: Fri, 04 Jul 2003 20:12:31 GMT
    !Path:
    cpmsftngxa09.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-onlin
    e.de!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed .icl.net!newsfeed.fjserv.n
    et!newsfeed.frii.net!newsfeed.frii.net!news-out.nuthinbutnews.com!propagator
    2-sterling!news-in-sterling.newsfeed.com!pd2nf1so.cg.shawcable.net!re sidenti
    al.shaw.ca!prodigy.com!prodigy.com!newsmst01.news. prodigy.com!prodigy.com!po
    stmaster.news.prodigy.com!newssvr23.news.prodigy.c om.POSTED!df277b9c!not-for
    -mail
    !Xref: cpmsftngxa09.phx.gbl microsoft.public.dotnet.framework.aspnet:32515
    !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    !
    !I've read some postings about when/how/where to open/close Db connections.
    !
    !My approach has been to use the Global.asax class, open at the start of a
    !request, place the connection in Session, use it throughout my app and then
    !close the connection at the end of the request again in the Global.asax
    !class, destroy it, and remove it from Session.
    !
    !I see this as scaleable, easy for the developers (they don't have to think
    !about the connection) and reliable, as the request will (almost) always end
    !and close the connection.
    !
    !Anyone see problems with this approach?
    !
    !... david ...
    !
    !
    !

    Yan-Hong Huang[MSFT] Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139