Re: Response.Flush: Differences between IIS 6.0 and 5.0?
From: David Wang [Msft] (someone_at_online.microsoft.com)
Date: 09/20/04
- Next message: David Wang [Msft]: "Re: how many Maximum connections for the 445 port simulteneaously."
- Previous message: Dodo: "6.0 SSL and WebDAV"
- In reply to: Anthony Marchesini: "Response.Flush: Differences between IIS 6.0 and 5.0?"
- Next in thread: Bernard: "Re: Response.Flush: Differences between IIS 6.0 and 5.0?"
- Reply: Bernard: "Re: Response.Flush: Differences between IIS 6.0 and 5.0?"
- Reply: Anthony Marchesini: "Re: Response.Flush: Differences between IIS 6.0 and 5.0?"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 20 Sep 2004 04:18:02 -0700
I can check on the behavior with the ASP/HTTP.SYS team.
I actually think that IIS6 does not violate your following statement:
"In other words, I do not expect my ASP script to continue running until the
entire response buffer has been sent to the client."
ASP did send the entire response buffer to the client prior to continuing
running. You are expecting ASP to wait until the client has ACK'd the
receipt of the response -- something quite impractical for a network
application. The important thing is that ASP maintains the integrity of the
network packet order -- but you can never make any assumptions about
networking timing.
The networking stack used by IIS6 (HTTP.SYS) is radically different than
IIS5 (Winsock), so differences are likely and may not be reconciled
depending on how serious they are.
-- //David IIS This posting is provided "AS IS" with no warranties, and confers no rights. // "Anthony Marchesini" <Arm07470@newsgroup.nospam> wrote in message news:%235hus1mnEHA.3464@tk2msftngp13.phx.gbl... It has always been my expectation and observation that Response.Flush is a synchronous operation. In other words, I do not expect my ASP script to continue running until the entire response buffer has been sent to the client. It appears that this is no longer the case under IIS 6.0. Here's an ASP page that I created to document this unexpected (and, for my application, undesirable) behavior: <% With Response 'Buffer 1 MB of HTML output .Buffer = True .Write "<html><body><!--" & String(1048559, "-") & ">" 'See how long it takes to Flush to the browser StartTime = Timer() .Flush StopTime = Timer() 'Output result .Write "Flush took " .Write FormatNumber(StopTime - StartTime, 3, -1) .Write " seconds to send 1 MB to the browser.</body></html>" .End End With %> Browsing to this ASP page hosted on an IIS 5.0 server yield the following output in the browser: Flush took 5.938 seconds to send 1 MB to the browser. With the following response headers: HTTP/1.1 200 OK Server: Microsoft-IIS/5.0 Date: Sun, 19 Sep 2004 16:29:27 GMT X-Powered-By: ASP.NET Connection: close Content-Type: text/html Cache-control: private Hosted on an IIS 6.0 server, I get this output in the browser: Flush took 0.016 seconds to send 1 MB to the browser. With the following response headers: HTTP/1.1 200 OK Connection: close Date: Sun, 19 Sep 2004 16:31:22 GMT Server: Microsoft-IIS/6.0 MicrosoftOfficeWebServer: 5.0_Pub X-Powered-By: ASP.NET Content-Type: text/html Cache-control: private The headers don't seem to reveal anything interesting. I have included them just to prove that there's no transfer encoding or compression going on that would explain the different results from the two servers. The interesting result is that Flush took almost no time to execute on IIS 6.0 and it took nearly 6 seconds on IIS 5.0. The 6 second result is expected if Flush is a synchronous operation since that's about how long it took to receive the page in my browser from both of the servers. The only explanation for the 0 second result on the 6.0 server is that Response.Flush is behaving asynchronously on that server. While I'm sure that asynchronous flushes would be desirable for many applications, it is highly undesirable for mine. I won't make this post any longer explaining why (unless someone really wants to know), just trust that I have a good reason. All of this boils down to two questions: 1) Is this change in behavior documented and expected? 2) Is there a way to get the old behavior back? - Anthony Marchesini
- Next message: David Wang [Msft]: "Re: how many Maximum connections for the 445 port simulteneaously."
- Previous message: Dodo: "6.0 SSL and WebDAV"
- In reply to: Anthony Marchesini: "Response.Flush: Differences between IIS 6.0 and 5.0?"
- Next in thread: Bernard: "Re: Response.Flush: Differences between IIS 6.0 and 5.0?"
- Reply: Bernard: "Re: Response.Flush: Differences between IIS 6.0 and 5.0?"
- Reply: Anthony Marchesini: "Re: Response.Flush: Differences between IIS 6.0 and 5.0?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|