IIS Serialize Request on ASP page

T

Tony Ser

Come across an issue with IIS process HTTP request one by one, not
simultaneously.

I have a page that takes a long time to process.
When the page is accessed by 2 seperate browser, both request will be
processed the same time. But if the 2nd browser is opened by IE->File->New
Window, when the 2 browsers try to access the same page, the requests are
handle sequentially.

Same behaviour with 2 firefox browser.

I notice second instance of IE opened by IE->File->New Window share the same
Session, but I have disabled the Session state on the IIS for testing. Still
have the same effect.

Any clue ?

The following code will introduce delay (I know it is not good code, just
something that could demo the issue)
Notice if 2 machine or 2 totally seperated browser try to access the page,
their start time and end time will overlap. But if you open the second IE
browser by IE->File->New Window, the startime and end time from 2 browser
does not overlap.

<%
Response.Buffer = true

Function WaitFor(SecDelay)
timeStart = Timer()
timeEnd = timeStart + SecDelay

Response.Write "Timer started at " & Time() & "<br>"

i = SecDelay
Do While timeStart < timeEnd
If i = Int(timeEnd) - Int(timeStart) Then
i = i - 1
End if
timeStart = Timer()
Loop

Response.Write "End time: " & Time()
End Function

Call WaitFor(20)
%>
 
A

Anthony Jones

Tony Ser said:
Come across an issue with IIS process HTTP request one by one, not
simultaneously.

I have a page that takes a long time to process.
When the page is accessed by 2 seperate browser, both request will be
processed the same time. But if the 2nd browser is opened by IE->File->New
Window, when the 2 browsers try to access the same page, the requests are
handle sequentially.

Same behaviour with 2 firefox browser.

I notice second instance of IE opened by IE->File->New Window share the same
Session, but I have disabled the Session state on the IIS for testing. Still
have the same effect.

Any clue ?

The following code will introduce delay (I know it is not good code, just
something that could demo the issue)
Notice if 2 machine or 2 totally seperated browser try to access the page,
their start time and end time will overlap. But if you open the second IE
browser by IE->File->New Window, the startime and end time from 2 browser
does not overlap.

<%
Response.Buffer = true

Function WaitFor(SecDelay)
timeStart = Timer()
timeEnd = timeStart + SecDelay

Response.Write "Timer started at " & Time() & "<br>"

i = SecDelay
Do While timeStart < timeEnd
If i = Int(timeEnd) - Int(timeStart) Then
i = i - 1
End if
timeStart = Timer()
Loop

Response.Write "End time: " & Time()
End Function

Call WaitFor(20)
%>

This is a strange result. Can you place some code that attempts to use the
session object to confirm that the session state is disabled. I've done a
similar test (ableit with an API Sleep instead of a compute intensive loop)
and found that with session state off the requests run in parrallel.

I can't see how IIS is going to distinguish two simultaneous requests from a
single client until it has an ASP session cookie with which to distinguish
them.

BTW I also checked that the browser isn't serialising the requests.
 
T

Tony Ser

Just found that it was my mistake before I see your post.
When I turn off session state, seem like I need to restart IIS before I can
see the requests run in parallel.

Now that we know it is related to Session State enabled. Is there a way to
make IIS process requests in parallel from the same session ? Or is it
deliberately done to prevent 2 requests from accessing the same Session
variables ?

Thanks!
Tony
 
A

Anthony Jones

Tony Ser said:
Just found that it was my mistake before I see your post.
When I turn off session state, seem like I need to restart IIS before I can
see the requests run in parallel.

Now that we know it is related to Session State enabled. Is there a way to
make IIS process requests in parallel from the same session ? Or is it
deliberately done to prevent 2 requests from accessing the same Session
variables ?

Soz about the late reply been on my hols.

The session object is a single threaded object. The session object cannot
be shared by two threads simulateously. Hence when there are two requests
for ASP scripts for the same session one is queued while the session object
is in use by the other.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top