2

My website runs on IIS7 and all scripts are coded in ASP Classic. I recently noticed while uploading a file on my website I cannot open any other pages.

This is the scenario: I start uploading a video file using a web form, while the file is being uploaded I attempt to open another page on the same website but it wouldn't receive and load a single byte unless the upload is fully done!

Any thoughts?

2 Answers2

3

The Session object is the cause of this. The Session object belongs to an STA (single threaded apartment). When a request arrives belonging to a specific session the worker thread handling the request will enter the apartment that the session object belongs to. However it can only do that if there is not another thread already in that apartment (because an STA can only accomodate one thread at a time).

So your browser starts uploading a file, an ASP request is being executed that is associated with that browser's session. A worker thread handling that upload request enters the apartment to which the session object belongs to. Now you are trying to load another page while that other request is still in progress. When this second request arrives ASP will find that it can't get another worker thread to enter the same sessions apartment because its already occupied with the first request. Hence ASP will place this second request in a queue waiting for the first to vacate the apartment.

The only way to avoid this would be to turn off ASP sessions. This would allow ASP to process requests from the same browser at the same time. However the serious downside is you will no longer have a Session object to work with. You would have to implement any server-side session management yourself including handling concurrency issues such as two requests trying to access any session data at the same time.

AnthonyWJones
  • 187,081
  • 35
  • 232
  • 306
  • Thanks Anthony. Very helpful information. I have been doing a lot of tweaks on my ASP Classic websites and it just keeps getting harder to run my very large websites on ASP technology as it is not being developed by MS anymore. So, I think it's best I switch technologies once and for all. What do you suggest? – Shahab Yarmohammadi Sep 27 '12 at 10:21
0

Only your site doesn't open or other sites too?

If its latter, buy a better package for your internet.

itachi
  • 6,323
  • 3
  • 30
  • 40