On Sun, 2 Nov 2003 23:36:19 -0500, "Trevor Joerges"
<[EMAIL PROTECTED]> wrote:

>Will setting the auto-flush variable $| to a non-zero value inside each CGI
>script resolve this?

No, $| is not being used for buffering inside PerlIS at all.  Each buffer
is always flushed immediately anyways, but nagling* on IIS5 might delay
blocks up to 200ms to combine them again.  All this is ISAPI specific and
doesn't apply to normal CGI mode.

Note that the problem mostly affects Perl 5.8 on IIS6:

                |      IIS 5      |        IIS 6
----------------+-----------------+------------------------
Perl 5.6 (635)  |   Unbuffered    |      Unbuffered
----------------+-----------------+------------------------
Perl 5.8 (806)  | Nagling* helps  | Transmit after each \n
----------------+-----------------+------------------------
Perl 5.8 (807+) |   Unbuffered    |      Unbuffered
----------------+-----------------+------------------------

I see that this is a bit confusing: the additional line and block
buffering in PerlIS 806 will actually send *more* (but smaller) packets
than the unbuffered mode.

For IIS6 (both Perl 5.6 and 5.8) you definitely want to minimize the calls
to print() you are making as each one will end up in a separate packet.
Network latency then will slow you down tremendously.

But for 806 this won't help you if you have newlines in your data because
PerlIS 806 and earlier will transmit a packet after each newline whatever
you do.  This is a bug and has been fixed for the next release.

[*] Nagling:

| The TCP protocol over which HTTP operates has an optimization that increases
| efficiency by trying to minimize the number of packets needed to send data.
| It works by waiting to send a packet until data area of the packet is full,
| or until a 200-millisecond timeout period expires, or until the sender
| indicates it is done sending data. This optimization is called nagling,
| and IIS versions 5.1 and earlier use it for all data sent to the client.

Cheers,
-Jan
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to