locked
httpRuntime - maxRequestLength vs requestLengthDiskThreshold? RRS feed

  • Question

  • User-1879291356 posted

    Hi All,

     

    This maybe the wrong place to post this question but I am looking at it from an architecture perspective. This question has been asked before from search on the forum but it was not answered so I am posting it again.

     

    What is the difference between "maxRequestLength" and "requestLengthDiskThreshold"? Like in the case below.

    <httpRuntime executionTimeout="300" maxRequestLength="20000" useFullyQualifiedRedirectUrl="false" requestLengthDiskThreshold="8192"/>

    There are lots of conflicting information on the net and would like to know what effect I will have on a website by adding this key.

    BTW - This would go in the web.config file for those that do not know.

     

     

    TIA

    Cool

    <httpruntime requestlengthdiskthreshold="8192" usefullyqualifiedredirecturl="false" maxrequestlength="20000" executiontimeout="300"></httpruntime>

    Wednesday, May 11, 2011 10:46 AM

Answers

  • User-952121411 posted

    The MaxRequestLength is the overall total length the request cannot exceed. The RequestLengthDiskThreshold should be less than the MaxRequestLength value and indicates at what point or 'threashold' that the request will begin to be buffered transparently onto disk. So take your following example:

    <httpRuntime maxRequestLength="20000" requestLengthDiskThreshold="8192"/>
    
    

    In this case the overall request cannot exceed 20000 kilobytes, and once the request crosses over the 8192 bytes threshold (Notice MaxRequestLength value is kilobytes and RequestLengthDiskThreshold is in bytes), the request will begin to buffer to disk (not be in memory anymore). The affect is when you want that request to stop being in memory and start to write or buffer to disk. Honestly I do not change the default value of 'RequestLengthDiskThreshold' to often; I leave it at the 256 byte threshold. Increasing this value might chew up too much memory in IIS and on the server, so buffering to disk does help keep memory management under control.

    Hope this helps! Smile

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 12, 2011 3:11 PM

All replies

  • User-952121411 posted

    The MaxRequestLength is the overall total length the request cannot exceed. The RequestLengthDiskThreshold should be less than the MaxRequestLength value and indicates at what point or 'threashold' that the request will begin to be buffered transparently onto disk. So take your following example:

    <httpRuntime maxRequestLength="20000" requestLengthDiskThreshold="8192"/>
    
    

    In this case the overall request cannot exceed 20000 kilobytes, and once the request crosses over the 8192 bytes threshold (Notice MaxRequestLength value is kilobytes and RequestLengthDiskThreshold is in bytes), the request will begin to buffer to disk (not be in memory anymore). The affect is when you want that request to stop being in memory and start to write or buffer to disk. Honestly I do not change the default value of 'RequestLengthDiskThreshold' to often; I leave it at the 256 byte threshold. Increasing this value might chew up too much memory in IIS and on the server, so buffering to disk does help keep memory management under control.

    Hope this helps! Smile

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 12, 2011 3:11 PM
  • User-1879291356 posted

    Thanks. That does help a lot.

    Monday, May 16, 2011 4:33 AM