Response Buffer Limit Exceeded

Discussion in 'ASP General' started by Ron Hinds, Nov 19, 2008.

  1. Ron Hinds

    Ron Hinds Guest

    I'm getting this in an ASP application on IIS6/W2K3. The page in question is
    trying to return a XML file approximately 45MB in size. Changing this is not
    an option. Worked fine on IIS5/W2K. I tried Response.Buffer = False, no joy.
    So I searched on MSDN and found instructions for increasing the
    AspBufferingLimit property in the metabase. I increased it to 100MB for that
    web application, stopped and restarted that web application, still same
    result.

    I ran into a similar problem on the same web app in two pages where we are
    trying to receive a file of approx. 10MB in size. I was told to set the
    AspMaxRequestEntityAllowed property in the metabase for the specific pages.
    I set it to 16MB for each - they still don't work, either. How can I make my
    legacy app work in IIS6?
     
    Ron Hinds, Nov 19, 2008
    #1
    1. Advertising

  2. "Ron Hinds" <> wrote in message
    news:...
    > I'm getting this in an ASP application on IIS6/W2K3. The page in question
    > is trying to return a XML file approximately 45MB in size. Changing this
    > is not an option. Worked fine on IIS5/W2K. I tried Response.Buffer =
    > False, no joy. So I searched on MSDN and found instructions for increasing
    > the AspBufferingLimit property in the metabase. I increased it to 100MB
    > for that web application, stopped and restarted that web application,
    > still same result.
    >
    > I ran into a similar problem on the same web app in two pages where we are
    > trying to receive a file of approx. 10MB in size. I was told to set the
    > AspMaxRequestEntityAllowed property in the metabase for the specific
    > pages. I set it to 16MB for each - they still don't work, either. How can
    > I make my legacy app work in IIS6?
    >
    >


    Perhaps you can describe exactly how you went about making those setting
    changes because they are exactly the right ones to correct your problem(s).

    --
    Anthony Jones - MVP ASP/ASP.NET
     
    Anthony Jones, Nov 19, 2008
    #2
    1. Advertising

  3. Ron wrote on Wed, 19 Nov 2008 13:07:33 -0800:

    > I'm getting this in an ASP application on IIS6/W2K3. The page in
    > question is trying to return a XML file approximately 45MB in size.
    > Changing this is not an option. Worked fine on IIS5/W2K. I tried
    > Response.Buffer = False, no joy. So I searched on MSDN and found
    > instructions for increasing the AspBufferingLimit property in the
    > metabase. I increased it to 100MB for
    > that web application, stopped and restarted that web application,
    > still same result.


    > I ran into a similar problem on the same web app in two pages where we
    > are trying to receive a file of approx. 10MB in size. I was told to
    > set the AspMaxRequestEntityAllowed property in the metabase for the
    > specific
    > pages. I set it to 16MB for each - they still don't work, either. How can
    > I
    > make my legacy app work in IIS6?



    I wouldn't go messing with the settings - instead, chunk out the XML file in
    small pieces. If this XML is coming from a file then you could use an ADO
    Stream object to do this quite simply. Even turning off the buffering
    doesn't help if you try to send a large file all in one go.

    AspMaxRequestEntityAllowed is for incoming data to the server, not for
    outgoing data - the clue is in the property name which contains the word
    Request. The value you would need to change is AspBufferLimit, eg.

    cscript.exe adsutil.vbs SET w3svc/aspbufferinglimit 104857600

    will increase the limit to 100MB. However, I would strongly recommend
    against this as it makes your application reliant on that setting. What
    happens when you want to push out a 250MB file, or a 500MB, or even bigger.
    Instead of adjusting that to suit your app, make your app send the file out
    in pieces.

    Here's some code that works on my site:


    Set oStream = Server.CreateObject("ADODB.Stream")
    Call oStream.Open()
    oStream.Type = 1
    call oStream.LoadFromFile(strDir & strFilename)

    Response.ContentType = "application/octet-stream"
    Response.AddHeader "Content-Disposition", "filename=" &
    strFilename & ";"
    Response.AddHeader "Content-Length", oStream.Size

    Response.Buffer = False

    'stream out the file in chunks
    Do While Not (oStream.EOS)
    Response.BinaryWrite oStream.Read(1024 * 256)
    Loop

    oStream.Close
    Set oStream = Nothing

    Response.End


    strDir and strFilename are variables holding the directory and the filename
    that is to be sent respectively.

    This sets the ContentType and filename in the headers, and it's total length
    so that the browser download dialog can show the user a progress percentage
    if supported. Buffering is then turned off (it's on by default for the
    server and this site too). It then reads 256kB at a time and sends it to the
    browser - sending in small chunks with buffering off automatically clears
    the buffer after each BinaryWrite call. So far it's worked well on all the
    files I've delivered from my application, although they have been reasonably
    small (up to around 35MB) but with the default 4MB limit of IIS6.

    --
    Dan
     
    Daniel Crichton, Nov 20, 2008
    #3
  4. Ron Hinds

    Ron Hinds Guest

    "Anthony Jones" <> wrote in message
    news:...
    > "Ron Hinds" <> wrote in message
    > news:...
    >> I'm getting this in an ASP application on IIS6/W2K3. The page in question
    >> is trying to return a XML file approximately 45MB in size. Changing this
    >> is not an option. Worked fine on IIS5/W2K. I tried Response.Buffer =
    >> False, no joy. So I searched on MSDN and found instructions for
    >> increasing the AspBufferingLimit property in the metabase. I increased it
    >> to 100MB for that web application, stopped and restarted that web
    >> application, still same result.
    >>
    >> I ran into a similar problem on the same web app in two pages where we
    >> are trying to receive a file of approx. 10MB in size. I was told to set
    >> the AspMaxRequestEntityAllowed property in the metabase for the specific
    >> pages. I set it to 16MB for each - they still don't work, either. How can
    >> I make my legacy app work in IIS6?
    >>
    >>

    >
    > Perhaps you can describe exactly how you went about making those setting
    > changes because they are exactly the right ones to correct your
    > problem(s).
    >


    Sorry it took so long to get back to you! OK, here is what I did:

    1. In IIS Manager, locate the file in question, right-click, go to
    Properties, HTTP Headers, check Enable content expiration, click Apply,
    un-check Enable content expiration (this creates the file in the metabase
    treeview)

    2. Start Metabase Explorer. Locate the web app, then the file. Right-click
    and add new DWORD record. Make the record name AspBufferingLimit. Click OK.

    3. Double-click the new record. On the value tab, enter 10485760 (10MB for
    example). On the General tab, set User Type to File and Attributes to
    Inheritable. Those last two weren't in the original instructions I got from
    Microsoft but I added them afterward since it didn't work the first time.

    4. Stop and restart the web application.

    If there is something I am missing, please let me know. Thank you!
     
    Ron Hinds, Dec 10, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Piotrowski

    Response Buffer Limit Exceeded Help Needed

    Brian Piotrowski, Aug 27, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    3,084
    Brian Piotrowski
    Aug 27, 2004
  2. Omar

    Response Buffer Limit Exceeded

    Omar, Feb 23, 2004, in forum: ASP General
    Replies:
    3
    Views:
    160
    Bob [BVP]
    Feb 26, 2004
  3. xingye
    Replies:
    9
    Views:
    276
    Michael Lu
    Apr 19, 2004
  4. Steve Bywaters

    Response Buffer Limit Exceeded

    Steve Bywaters, Aug 28, 2004, in forum: ASP General
    Replies:
    2
    Views:
    321
    Egbert Nierop \(MVP for IIS\)
    Aug 28, 2004
  5. Brian Piotrowski

    Response Buffer Limit Exceeded Problems - Ideas Please!

    Brian Piotrowski, Sep 7, 2004, in forum: ASP General
    Replies:
    3
    Views:
    231
    Brian Piotrowski
    Sep 8, 2004
Loading...

Share This Page