You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@covalent.net on 2002/05/30 19:55:16 UTC

PROPOSAL: clientFlush() method

Hi,

I would like to add a new method to Response. 

clientFlush() will be called by ServletOutputStream.flush() to notify the
container ( and the low level connector ) that the user has explicitely 
asked for the stream to be flushed. 

The default impl. will be empty, and in coyote adapter we'll generate
an Action.CLIENT_FLUSH that may be interpreted by the connector.

This would allow the connector to increase the granularity, which in 
turns result in about 20% reduction in the overhead ( for ajp/socket ).

This happens by allowing the use of a BufferedOutputStream on the
socket - the packets to send the header and the first chunk and
the end response messages will all be sent at once, in one 
write() operation instead of 3. 

The servlet spec allows us to do that, but we must honor the flush()
requests.

I'll leave the option as disabled in jk2 ( since 4.1 and the current
3.3 doesn't support this ), but an option will enable the buffered 
writing.

Comments ? Larry, Bill ? 

( I tested this with 3.3 - Remy, I suppose something similar will be done
in a future release of 4.1.x, I don't want to delay the release )

Costin


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: PROPOSAL: clientFlush() method

Posted by Bill Barker <wb...@wilshire.com>.
----- Original Message -----
From: <co...@covalent.net>
To: "List Tomcat-Dev" <to...@jakarta.apache.org>
Sent: Thursday, May 30, 2002 10:55 AM
Subject: PROPOSAL: clientFlush() method


> Hi,
>
> I would like to add a new method to Response.

+1

>
> clientFlush() will be called by ServletOutputStream.flush() to notify the
> container ( and the low level connector ) that the user has explicitely
> asked for the stream to be flushed.

Presumably, it would need to be called by ServletWriter.flush() as well.

>
> The default impl. will be empty, and in coyote adapter we'll generate
> an Action.CLIENT_FLUSH that may be interpreted by the connector.
>
> This would allow the connector to increase the granularity, which in
> turns result in about 20% reduction in the overhead ( for ajp/socket ).
>
> This happens by allowing the use of a BufferedOutputStream on the
> socket - the packets to send the header and the first chunk and
> the end response messages will all be sent at once, in one
> write() operation instead of 3.
>
> The servlet spec allows us to do that, but we must honor the flush()
> requests.
>
> I'll leave the option as disabled in jk2 ( since 4.1 and the current
> 3.3 doesn't support this ), but an option will enable the buffered
> writing.
>
> Comments ? Larry, Bill ?
>
> ( I tested this with 3.3 - Remy, I suppose something similar will be done
> in a future release of 4.1.x, I don't want to delay the release )
>
> Costin
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>