asp.net-mvcsessioniisasyncfileupload

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!


Solution

  • 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
    {
    
    }