Large Uploads in ASP.NET


  1. UpFilesBE HTTPModule
  2. Connection Timeout
  3. .NET Settings
1. UpFilesBE HTTPModule

UpFilesBEModule, UpFilesBE's HTTPModule intercepts the incoming upload request before it reaches the ASP.NET. After interception the module off-loads and caches, chunk by chunk, the incoming file's data to a temp file. Finally it re-assembles the request and forwards it to ASP.NET without the files data. This overcomes ASP.NET's inefficient memory utilization and allows accurate progress monitoring.

For the samples included with UpFilesBE, the installer package will automatically install the UpFilesBEModule. The UpFilesBEModule assembly is installed into the GAC and is also available in the reference dialog. The HttpModules section of the web.config file has an entry for the UpFilesBEModule. To manually install/uninstall the UpFilesBE's HTTPModule please see instructions in Installing the UpFilesBEModule.


NOTE:
The UpFilesBE's HTTPModule and the Progress Monitor
Under ASP.NET, UpFilesBE progress monitoring is accomplished through the UpFilesBEModule. For displaying accurate progress, the ProgressIndicator parameter of the UpFilesBEParams section must be set to "1".


2. ConnectionTimeout

IIS will disconnect an inactive connection in a time interval determined by a value set by the Connection Timeout property. It may be necessary to increase this value to let very large uploads to complete. The default value of Connection Timeout is 120 seconds. To modify this value from IIS Management Console:

  • Right-click Default web Site and select Properties .
  • Enter a new value in the Connection Timeout box within the Web Site tab.
3. .NET Settings

Following is the list of, an ASP.NET web application configuration, attributes that can affect the performance of large uploads.

  1. executionTimeout
    Request time out in seconds.
  2. maxRequestLength
    Maximum size in kilobytes beyond which ASP.NET will reject a request.
  3. appRequestQueueLimit
    Maximum number of requests allowed in an ASP.NET application queue. This value may have to be increased in case the server will be handling more than the default value of 100 concurrent requests.
These attributes can be set at the machine level or at the application level.

Modifications to the machine.config file, located at
[windows directory]\Microsoft.NET\Framework\[.NET Version Directory]\CONFIG ,
should be done to set these attributes at the machine level

Modifications to the web.config file, (located within the web application), should be done to set these attributes at the application level.



Following is a list of another set of an ASP.NET web application configuration attributes that can affect the performance of large uploads. These attributes are located in the processModel node of machine.config:

  1. responseDeadlockInterval
    A value indicating the time interval for the worker process to respond. The process is restarted if there are 1) queued requests and 2) if there has been no response during this time interval. Three (3) minutes is the default value for responseDeadlockInterval. Very large uploads taking long time can result in the above two conditions. This requires a modification to this value of Interval. This property must be set only in machine.config file. This attribute has a global effect caused by any response deadlock in ASP.NET and should be used with discretion.
  2. maxIoThreads
    Number of IO threads per CPU in the thread pool determines the number of concurrent executing requests. If there is a large number of concurrent uploads to be expected in a web site then maxIoThreads should be set to reflect that number.
These attributes must be set at only the machine level.

Modifications to the machine.config file, located at
[windows directory]\Microsoft.NET\Framework\[.NET Version Directory]\CONFIG ,
should be done to set these attributes.


Copyright © 2007 expandata Inc. All rights reserved.