Response Buffer Limit Exceeded

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ron Hinds

    Response Buffer Limit Exceeded

    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
    AspBufferingLim it 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
    AspMaxRequestEn tityAllowed 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?



  • Anthony Jones

    #2
    Re: Response Buffer Limit Exceeded

    "Ron Hinds" <billg@microsof t.comwrote in message
    news:exYVYroSJH A.5080@TK2MSFTN GP03.phx.gbl...
    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 AspBufferingLim it 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
    AspMaxRequestEn tityAllowed 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

    Comment

    • Daniel Crichton

      #3
      Re: Response Buffer Limit Exceeded

      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 AspBufferingLim it 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 AspMaxRequestEn tityAllowed 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.

      AspMaxRequestEn tityAllowed 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/aspbufferinglim it 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.CreateOb ject("ADODB.Str eam")
      Call oStream.Open()
      oStream.Type = 1
      call oStream.LoadFro mFile(strDir & strFilename)

      Response.Conten tType = "applicatio n/octet-stream"
      Response.AddHea der "Content-Disposition", "filename=" &
      strFilename & ";"
      Response.AddHea der "Content-Length", oStream.Size

      Response.Buffer = False

      'stream out the file in chunks
      Do While Not (oStream.EOS)
      Response.Binary Write oStream.Read(10 24 * 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


      Comment

      Working...