Response Buffer Limit Exceeded

165.6k views Asked by At

I am running a simple query to get data out of my database & display them. I'm getting an error that says Response Buffer Limit Exceeded.

Error is : Response object error 'ASP 0251 : 80004005'
Response Buffer Limit Exceeded
/abc/test_maintenanceDetail.asp, line 0
Execution of the ASP page caused the Response Buffer to exceed its configured limit.

I have also tried Response.flush in my loop and also use response.buffer = false in my top of the page, but still I am not getting any data.

My database contains 5600 records for that, Please give me some steps or code to solve the issue.

12

There are 12 answers

0
sanme98 On

It can be due to CursorTypeEnum also. My scenario was the initial value equal to CursorTypeEnum.adOpenStatic 3.

After changed to default, CursorTypeEnum.adOpenForwardOnly 0, it backs to normal.

0
Edison Neza On

In my case i just have writing this line before rs.Open .....

Response.flush

rs.Open query, conn

0
Matt Dawdy On

One other answer to the same error message (this just fixed my problem) is that the System drive was low on disk space. Meaning about 700kb free. Deleting a lot of unused stuff on this really old server and then restarting IIS and the website (probably only IIS was necessary) cause the problem to disappear for me.

I'm sure the other answers are more useful for most people, but for a quick fix, just make sure that the System drive has some free space.

0
Ali Sheikhpour On

If you are looking for the reason and don't want to fight the system settings, these are two major situations I faced:

  1. You may have an infinite loop without next or recordest.movenext
  2. Your text data is very large but you think it is not! The common reason for this situation is to copy-paste an Image from Microsoft word directly into the editor and so the server translates the image to data objects and saves it in your text field. This can easily occupies the database resources and causes buffer problem when you call the data again.
0
Shanaka Rathnayaka On

You can increase the limit as follows:

  1. Stop IIS.
  2. Locate the file %WinDir%\System32\Inetsrv\Metabase.xml
  3. Modify the AspBufferingLimit value. The default value is 4194304, which is about 4 MB. Changing it to 20MB (20971520).
  4. Restart IIS.
3
SMM On

I know this is way late, but for anyone else who encounters this problem: If you are using a loop of some kind (in my case, a Do-While) to display the data, make sure that you are moving to the next record (in my case, a rs.MoveNext).

0
Kalaine On

Thank you so much! <%Response.Buffer = False%> worked like a charm! My asp/HTML table that was returning a blank page at about 2700 records. The following debugging lines helped expose the buffering problem: I replace the Do While loop as follows and played with my limit numbers to see what was happening:

Replace

Do While not rs.EOF

'etc .... your block of code that writes the table rows

rs.moveNext

Loop

with

Do While reccount < 2500

if rs.EOF then recount = 2501

'etc .... your block of code that writes the table rows

rs.moveNext

Loop

response.write "recount = " & recount

raise or lower the 2500 and 2501 to see if it is a buffer problem. for my record set, I could see that the blank page return, blank table, was happening at about 2700 records, good luck to all and thank you again for solving this problem! Such a simple great solution!

0
Blair On

I rectified the error 'ASP 0251 : 80004005' Response Buffer Limit as follow:

To increase the buffering limit in IIS 6, follow these steps:

Click Start, click Run, type cmd, and then click OK. Type the following command, and then press ENTER: cd /d %systemdrive%\inetpub\adminscripts Type the following command, and then press ENTER: cscript.exe adsutil.vbs SET w3svc/aspbufferinglimit LimitSize Note LimitSize represents the buffering limit size in bytes. For example, the number 67108864 sets the buffering limit size to 64 MB. To confirm that the buffer limit is set correctly, follow these steps:

Click Start, click Run, type cmd, and then click OK. Type the following command, and then press ENTER: cd /d %systemdrive%\inetpub\adminscripts Type the following command, and then press ENTER: cscript.exe adsutil.vbs GET w3svc/aspbufferinglimit

refers to https://support.microsoft.com/en-us/kb/944886

0
Arulkumar On

I faced the same kind of issue, my IIS version is 8.5. Increased the Response Buffering Limit under the ASP -> Limit Properties solved the issue.

  1. In IIS 8.5, select your project, you can see the options in the right hand side. In that under the IIS, you can see the ASP option.

ASP option

  1. In the option window increase the Response Buffering Limit to 40194304 (approximately 40 MB) .

Increase buffer limit

  1. Navigate away from the option, in the right hand side top you can see the Actions menu, Select Apply. It solved my problem.

Apply settings

2
Muhammad Naveed On

The reason this is happening is because buffering is turned on by default, and IIS 6 cannot handle the large response.

In Classic ASP, at the top of your page, after <%@Language="VBScript"%> add: <%Response.Buffer = False%>

In ASP.NET, you would add Buffer="False" to your Page directive. For example: <%@Page Language="C#" Buffer="False"%>

0
stevepowell2000 On

If you are not allowed to change the buffer limit at the server level, you will need to use the <%Response.Buffer = False%> method.

HOWEVER, if you are still getting this error and have a large table on the page, the culprit may be table itself. By design, some versions of Internet Explorer will buffer the entire content between before it is rendered to the page. So even if you are telling the page to not buffer the content, the table element may be buffered and causing this error.

Some alternate solutions may be to paginate the table results, but if you must display the entire table and it has thousands of rows, throw this line of code in the middle of the table generation loop: <% Response.Flush %>. For speed considerations, you may also want to consider adding a basic counter so that the flush only happens every 25 or 100 lines or so.

Drawbacks of not buffering the output:

  1. slowdown of overall page load
  2. tables and columns will adjust their widths as content is populated (table appears to wiggle)
  3. Users will be able to click on links and interact with the page before it is fully loaded. So if you have some javascript at the bottom of the page, you may want to move it to the top to ensure it is loaded before some of your faster moving users click on things.

See this KB article for more information http://support.microsoft.com/kb/925764

Hope that helps.

1
cmujica On

Here is what a Microsoft support page says about this: https://support.microsoft.com/en-us/help/944886/error-message-when-you-use-the-response-binarywrite-method-in-iis-6-an.

But it’s easier in the GUI:

  • In Internet Information Services (IIS) Manager, click on ASP.
  • Change Behavior > Limits Properties > Response Buffering Limit from 4 MB to 64 MB.
  • Apply and restart.