Professional Web Applications Themes

recordset and estimation of memory allocation - ASP Database

Hi, I have some questions about recordset and memory size. I have a Access table with 1 field: one text (50 char). The table contains 20000 records. Question 1) When following code between <% %>is executed, everything happens on the server, right? Sofar, there is no transfert to the client, still right? <% set objdc = Server.CreateObject("ADODB.Connection") objdc.Open("provider=Microsoft.Jet.OLEDB.4.0; Data Source =c:\mydb.mdb") sql="select field1 from mytable;" set rs=Server.CreateObject("ADODB.Recordset") rs.open sql, OBJDC, 3, 3 %> Suppose there are 100 users who run that code together, i wonder whether the memory (RAM) of the server will be big enough. Question 2) Is this ...

  1. #1

    Default recordset and estimation of memory allocation

    Hi,

    I have some questions about recordset and memory size.
    I have a Access table with 1 field: one text (50 char). The table contains
    20000 records.
    Question 1)
    When following code between <% %>is executed, everything happens on the
    server, right? Sofar, there is no transfert to the client, still right?
    <%
    set objdc = Server.CreateObject("ADODB.Connection")
    objdc.Open("provider=Microsoft.Jet.OLEDB.4.0; Data Source =c:\mydb.mdb")
    sql="select field1 from mytable;"
    set rs=Server.CreateObject("ADODB.Recordset")
    rs.open sql, OBJDC, 3, 3
    %>

    Suppose there are 100 users who run that code together, i wonder whether the
    memory (RAM) of the server will be big enough.

    Question 2)
    Is this way to calculate the 100 recordsets correct?
    50 char x 20000 records x 100 users = 100 million bytes or more or less 100
    mega bytes. So i need at least a RAM of 100 mega, right?

    Question 3)
    If this is correct, what will happen if the server has only 64 mega bytes?


    Last question 4):
    if i put the whole recordset into an array with a Javascript on the client
    computer, can i apply the same method to estimate the RAM size?

    Thanks for make me understanding those topics.
    Walter


    Walter Guest

  2. #2

    Default Re: recordset and estimation of memory allocation

    Walter wrote: 

    Right, unless Response.Write is used with no buffering.
     

    Given that only a limited number of threads is allowed at one time, the
    memory should be fine, unless your query returns millions of rows and field1
    is a memo field containing large amounts of data.
     

    ?? Why are you retrieving that many records at once??
     

    No. Only a limited number of threads is allowed at one time, so some of your
    users will wait for results. If you are really retrieving 20000 records(!)
    at a time, some iof them may have a while to wait if all 100 of them push
    the button at the same moment ... depending on what you are doing with those
    20000 records of course.

     

    It would start paging to disk, slowing things down. But it won't happen.
     

    Again, you will not have 100 threads running simultaneously. Also, you will
    need to use recordsets to get the data from the database in order to
    populate the arrays (hopefully using the ADO GetRows method), won't you?

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Guest

  3. #3

    Default Re: recordset and estimation of memory allocation

    Thanks for your explanation. Maybe two more questions:

    I can see in mms of iis on my server that the property "Connections" is put
    on Unlimited.
    Is that what you mean with "thread" and if no, where can i set the amount of
    threads and how to determine the optimal amount?

    Suppose i'm the only client, then if i put the whole recordset (20000) into
    an array with a Javascript on the client computer, i need 20000 x 50 char
    bytes memory?

    Thanks again for your time


    "Bob Barrows [MVP]" <SPAMcom> wrote in message
    news:phx.gbl... 
    >
    > Right, unless Response.Write is used with no buffering.

    >
    > Given that only a limited number of threads is allowed at one time, the
    > memory should be fine, unless your query returns millions of rows and[/ref]
    field1 
    >
    > ?? Why are you retrieving that many records at once??

    >
    > No. Only a limited number of threads is allowed at one time, so some of[/ref]
    your 
    those 
    >
    > It would start paging to disk, slowing things down. But it won't happen.

    >
    > Again, you will not have 100 threads running simultaneously. Also, you[/ref]
    will 


    Walter Guest

  4. #4

    Default Re: recordset and estimation of memory allocation

    Walter wrote: 

    No
     

    http://www.winnetmag.com/Article/ArticleID/13989/13989.html

    but don't do this unless you know what you are doing. Do some Google
    searching or get a book about IIS administration. Make sure you are aware of
    all the ramifications before you blindly increase the number of threads.
     
    Maybe slightly more - there's a little overhead for the data structure
    itself. You probably want to ask on a client-side newsgroup.

    Bob Barrows

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Guest

  5. #5

    Default Re: recordset and estimation of memory allocation

    thanks

    "Bob Barrows [MVP]" <SPAMcom> wrote in message
    news:%phx.gbl... 
    >
    > No

    >
    > http://www.winnetmag.com/Article/ArticleID/13989/13989.html
    >
    > but don't do this unless you know what you are doing. Do some Google
    > searching or get a book about IIS administration. Make sure you are aware[/ref]
    of 
    > Maybe slightly more - there's a little overhead for the data structure
    > itself. You probably want to ask on a client-side newsgroup.
    >
    > Bob Barrows
    >
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >[/ref]


    Walter Guest

Similar Threads

  1. #40701 [NEW]: Memory allocation error
    By michaeldaly at magma dot ca in forum PHP Bugs
    Replies: 25
    Last Post: April 25th, 07:56 PM
  2. How do i adjust memory allocation on mac osx for Freehand MX ??
    By James Noon in forum Macromedia Freehand
    Replies: 2
    Last Post: December 18th, 09:14 PM
  3. Memory allocation error - esql/c
    By R?diger in forum Informix
    Replies: 4
    Last Post: December 4th, 06:43 AM
  4. memory allocation problems in PHP and how to optimize?
    By lawrence in forum PHP Development
    Replies: 2
    Last Post: October 16th, 04:24 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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