Philiz
Philiz

Reputation: 333

Concurrent files uploads on IIS 10 never succeed and freeze the user session

Configuration:

Windows Server 2016 4Gb ram, ASP.NET MVC 5, IIS-10, Max upload size per request:30M

Problem:

When uploading 5 image files of 500Ko asynchronously, the user session freezes and the uploads never succeed. If I try to reach another page of the website from the same browser, it hangs. From another browser, I can reach any pages of the website. The user session hangs until I restart the website in the IIS.

As soon as I restart the website, the all uploads resume uploading and succeed as it would normally do and all the pages of the website are again reachable by the user.

What I tried so far:

  1. Up to 4 images of 500Ko, it is working fine. If I take images of 5M each instead, it works for 1 upload but not 2 concurrent uploads.
  2. If I run the website on my local computer, it is working fine.

Any ideas what could lead to such a situation?
Thank you!

Upvotes: 1

Views: 1086

Answers (2)

Timothy Parkinson
Timothy Parkinson

Reputation: 46

I experienced the exact same issue and Brando's answer helped me find the solution.

Try adding [SessionState(SessionStateBehavior.Disabled)] to the line above your controller processing your image uploads.

Like so:

[SessionState(SessionStateBehavior.Disabled)]
public class ImagesController : Controller
{

}

Upvotes: 3

Brando Zhang
Brando Zhang

Reputation: 28257

According to your description, I guess you may face the session lock issue. I suggest you could try to debugdiag to capture the dump file and analysis the dump file to find out the reason.

debugdiag download link: https://www.microsoft.com/en-us/download/details.aspx?id=49924

Steps: 1. Open the debugdiag and select performance. enter image description here

  1. Go next and select HTTP response times enter image description here

  2. Click next and add the url with timeout value enter image description here

  3. Click next and click add dump target and select target type to web application pool and select the right application pool enter image description here
  4. Click next and select full dump and click next enter image description here
  5. Type in the dump rule name and click next enter image description here

More details, you could refer to below article: https://support.microsoft.com/en-ca/help/919792/how-to-use-the-debug-diagnostics-tool-to-troubleshoot-a-process-that-h

Upvotes: 0

Related Questions