IIS Serialize Request on ASP page

IIS Serialize Request on ASP page

am 24.08.2007 19:14:04 von TonySer

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() & "
"

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)
%>

Re: IIS Serialize Request on ASP page

am 24.08.2007 21:59:50 von Anthony Jones

"Tony Ser" wrote in message
news:952294A5-4EA1-4662-9738-665339E6700E@microsoft.com...
> 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() & "
"
>
> 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.

--
Anthony Jones - MVP ASP/ASP.NET

Re: IIS Serialize Request on ASP page

am 24.08.2007 22:16:30 von TonySer

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

"Anthony Jones" wrote:

> "Tony Ser" wrote in message
> news:952294A5-4EA1-4662-9738-665339E6700E@microsoft.com...
> > 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() & "
"
> >
> > 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.
>
> --
> Anthony Jones - MVP ASP/ASP.NET
>
>
>

Re: IIS Serialize Request on ASP page

am 01.09.2007 17:37:45 von Anthony Jones

"Tony Ser" wrote in message
news:69F26147-B6AB-4E8B-A589-87F9D4246709@microsoft.com...
> 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.


--
Anthony Jones - MVP ASP/ASP.NET

>
> "Anthony Jones" wrote:
>
> > "Tony Ser" wrote in message
> > news:952294A5-4EA1-4662-9738-665339E6700E@microsoft.com...
> > > 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() & "
"
> > >
> > > 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.
> >
> > --
> > Anthony Jones - MVP ASP/ASP.NET
> >
> >
> >