惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
SegmentFault 最新的问题
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Attack and Defense Labs
Attack and Defense Labs
F
Full Disclosure
Vercel News
Vercel News
N
News | PayPal Newsroom
The GitHub Blog
The GitHub Blog
H
Hacker News: Front Page
H
Heimdal Security Blog
P
Privacy International News Feed
博客园 - 司徒正美
Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cisco Blogs
L
Lohrmann on Cybersecurity
D
Docker
Recent Announcements
Recent Announcements
Security Archives - TechRepublic
Security Archives - TechRepublic
人人都是产品经理
人人都是产品经理
C
CXSECURITY Database RSS Feed - CXSecurity.com
P
Proofpoint News Feed
T
Tailwind CSS Blog
C
Check Point Blog
博客园 - 叶小钗
Google Online Security Blog
Google Online Security Blog
Martin Fowler
Martin Fowler
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
S
Secure Thoughts
博客园 - Franky
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
P
Palo Alto Networks Blog
Latest news
Latest news
量子位
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 三生石上(FineUI控件)
The Cloudflare Blog
Last Week in AI
Last Week in AI
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Cyberwarzone
Cyberwarzone
小众软件
小众软件
Cisco Talos Blog
Cisco Talos Blog
Hacker News: Ask HN
Hacker News: Ask HN
T
Threatpost
T
Tenable Blog
P
Privacy & Cybersecurity Law Blog
WordPress大学
WordPress大学

博客园 - 阿兰德隆

技术文章杂项罗列-1 ASP.NET CLIENTSIDE BEHAVIORS WSS Generic tech tutorials DATA concurrency in ADO.NET ASP.NET Browser compatibility related reference ***Internationalization related tech articles*** .net common utility frameworks WINFORM develop tech articles and tutorials VC++ third party shared components #Good EBook Download Sites ASP.NET Web Server Control 开发系列 工具系列 XML 相关技术 ASP.NET Performance Related Tech Reference Office document manipulation tech articles ASP.NET 第三方控件系列 VS.NET DESIGN-TIME Issues 层次型嵌套数据绑定以及关联数据插入模式 .NET 开发者10件必备武器:)
ASP.NET BUILDIN FILEUPLOAD ISSUE
阿兰德隆 · 2004-07-23 · via 博客园 - 阿兰德隆

Forward from

http://weblogs.asp.net/mhawley/archive/2004/05/11/129824.aspx

Large File Uploading in ASP.NET

I posted this to the ASP.NET forums back in November of 2002, and, too much of my dismay, still is an issue and people are still having problems figuring this out. I don't really know how many times I've helped people with this problem, and just recently I had to do the same. So, for my own personal reference (mainly), and to share the information, I decided to re-post it in my blog...

First the good...

To upload large files, and not receive the DNS Error or the page stopping while uploading, we found several settings between the machine.config and the web.config files that you need to modify. There are specifically 3 places, 2 of which can be overwritten in your web.config file.

In your web.config, add a line under your system.web <httpRuntime executionTimeout="54000" maxRequestLength="512000" /> where execution timeout is in seconds, and maxRequestLength is in KB. executionTimeout, is basically the amount of time a thread will continue to run, and accept data by IIS/.NET. maxRequestLength, is the total amount of data that can be sent through HTTP Post to the server. The default is 4MB (4096)...and is generally set low so that your server will not be overwhelmed by possible DoS attacks.

In your machine.config, modify responseDeadlockInterval to equal the same amount of time for executionTimeout. responseDeadlockInterval, is basically the amount of time that the Client's browser and Server will continue to communicate. Every several minutes or so, the server polls the client, asking if they have any more information to send, if they do not receive anything back after several times, then the server stops the current thread and all communication is stopped. This is the cause of the DNS Error you may see sometimes.

These 3 changes will allow you to successfully upload large files.

Now...the bad...

Memory deallocation is a major issue, that has no current solution. Whenever you upload files via HTTP Post, the file is stored in the memory of the aspnet_wp.exe process, and never deallocates completely (if your lucky a few MB gets released). One of the config settings for .NET processes, allows them to utilize 60% of physical memory on the server, at which point the process is recycled and all execution is stopped. Whenever a new upload is started, though, some memory is de-allocated, but not enough compared to memory that was used in prior uploads.

Microsoft is aware of this problem, and has assured us that it will be fixed with some upcoming releases of the .NET framework. Some solutions that they suggested to us, was to use Classic ASP, Third Party Components, or Custom Built ISAPI filters. Because of our solution we were using this in, we could do none of the three, so we topped the server out at 2GB of RAM. This has provided us with some breathing room if several people start uploading huge files, and gives us enough time to restart IIS if we start nearing 1.3GB of RAM being used by aspnet_wp.exe.