You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by pe...@apache.org on 2006/12/12 17:35:16 UTC

svn commit: r486219 - /tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/connector/Response.java

Author: pero
Date: Tue Dec 12 08:35:15 2006
New Revision: 486219

URL: http://svn.apache.org/viewvc?view=rev&rev=486219
Log:
Add support to send and receive more the 8K BODY packets.

Modified:
    tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/connector/Response.java

Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/connector/Response.java
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/connector/Response.java?view=diff&rev=486219&r1=486218&r2=486219
==============================================================================
--- tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/connector/Response.java (original)
+++ tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/connector/Response.java Tue Dec 12 08:35:15 2006
@@ -132,8 +132,24 @@
         this.connector = connector;
         if("AJP/1.3".equals(connector.getProtocol())) {
             // default size to size of one ajp-packet
-            outputBuffer = new OutputBuffer(8184);
-        } else {
+        	Object packetSize = (Object)connector.getProperty("packetSize") ;
+        	int valuePacketSize = 8192 ;
+        	if(packetSize != null) {
+        		if (packetSize instanceof Integer) {
+        			valuePacketSize =((Integer)packetSize).intValue();
+				} else {
+		       		if (packetSize instanceof String) {
+		       			if(!"".equals(packetSize))
+		       				valuePacketSize = new Integer((String)packetSize).intValue();
+					}
+				}       	    	   
+        		if(valuePacketSize < 8192 )
+        			valuePacketSize = 8192 ;
+        	}
+        	// Reduce HSIZE and Command = 6 Bytes
+       		outputBuffer = new OutputBuffer(valuePacketSize - 6 );
+
+         } else {
             outputBuffer = new OutputBuffer();
         }
         outputStream = new CoyoteOutputStream(outputBuffer);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r486219 - /tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/connector/Response.java

Posted by Remy Maucherat <re...@apache.org>.
Peter Rossbach wrote:
> Hi Remy,
> 
> can you explain why we use packetSize at AjpAprProcessor attribute 
> bodyMessage and responseHeaderMessage?
> 
>         requestHeaderMessage = new AjpMessage(packetSize);
>         responseHeaderMessage = new AjpMessage(packetSize);
>         bodyMessage = new AjpMessage(packetSize);
> 
> We want only send 8K packets!
> 
> Other problem I see now is: That we can create a packetSize 
> responseHeader greater then 8K but
> the Outputbuffer (SocketOutputBuffer) can only handle 8K packets.

I don't think the output buffer limitation prevents using more than 8K 
for the HTTP response header (ex: with lots of cookies). It's a bit 
cut&pasted from the HTTP connector, though, so bodyMessage = new 
AjpMessage(packetSize); is probably not useful (I did not think about it 
a lot before porting the packetSize support to these connectors).

I think it's worth testing a little bit, to see if 16KB packets perform 
better, for example. If it does not, then only the first header of the 
request and the response really need to have a bigger size.

Rémy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r486219 - /tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/connector/Response.java

Posted by Peter Rossbach <pr...@objektpark.de>.
Hi Remy,

can you explain why we use packetSize at AjpAprProcessor attribute  
bodyMessage and responseHeaderMessage?

         requestHeaderMessage = new AjpMessage(packetSize);
         responseHeaderMessage = new AjpMessage(packetSize);
         bodyMessage = new AjpMessage(packetSize);

We want only send 8K packets!

Other problem I see now is: That we can create a packetSize  
responseHeader greater then 8K but
the Outputbuffer (SocketOutputBuffer) can only handle 8K packets.

Regards
Peter

Am 12.12.2006 um 22:49 schrieb Remy Maucherat:

> Peter Rossbach wrote:
>> Yes, but as I configured packetSize greater then 8k, I would like  
>> to see that ajp send those big chunks.
>
> This will not be useful performance wise. The increased packet size  
> is useful for sending certificates data in the first packet of the  
> request, and that's about it.
>
>> Currently mod_jk 1.2.20 accept those packets, but don't send  
>> bigger pakets then 8k ( see my separate posting).
>
> Which is most likely useless.
>
>> More memory is not a big argument. 8k is default, and only at  
>> spezial case user use greater packetSize. Greater
>> PacketSize means that you send fewer GET BODY messages. This  
>> reduce the ajp handshake overhead.
>
> People will need to use more than 8KB is they have a large cert  
> chain, but will not benefit in any way from using larger packets on  
> output other than using more memory. I don't understand why you are  
> talking about "get body" messages since your changes are for  
> output, not input. If you can provide data which shows a  
> performance gain, then this could be considered.
>
> So -1 for your changes (it's a definitive veto in 5.5 since it is  
> the stable branch; I'm still against it in 6.0 unless you can prove  
> it provides a significant benefit).
>
> Rémy
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r486219 - /tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/connector/Response.java

Posted by Peter Rossbach <pr...@objektpark.de>.
OK,

I have revert the change.

Peter



Am 12.12.2006 um 22:49 schrieb Remy Maucherat:

> Peter Rossbach wrote:
>> Yes, but as I configured packetSize greater then 8k, I would like  
>> to see that ajp send those big chunks.
>
> This will not be useful performance wise. The increased packet size  
> is useful for sending certificates data in the first packet of the  
> request, and that's about it.
>
>> Currently mod_jk 1.2.20 accept those packets, but don't send  
>> bigger pakets then 8k ( see my separate posting).
>
> Which is most likely useless.
>
>> More memory is not a big argument. 8k is default, and only at  
>> spezial case user use greater packetSize. Greater
>> PacketSize means that you send fewer GET BODY messages. This  
>> reduce the ajp handshake overhead.
>
> People will need to use more than 8KB is they have a large cert  
> chain, but will not benefit in any way from using larger packets on  
> output other than using more memory. I don't understand why you are  
> talking about "get body" messages since your changes are for  
> output, not input. If you can provide data which shows a  
> performance gain, then this could be considered.
>
> So -1 for your changes (it's a definitive veto in 5.5 since it is  
> the stable branch; I'm still against it in 6.0 unless you can prove  
> it provides a significant benefit).
>
> Rémy
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>


Re: svn commit: r486219 - /tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/connector/Response.java

Posted by Remy Maucherat <re...@apache.org>.
Peter Rossbach wrote:
> Yes, but as I configured packetSize greater then 8k, I would like to see 
> that ajp send those big chunks.

This will not be useful performance wise. The increased packet size is 
useful for sending certificates data in the first packet of the request, 
and that's about it.

> Currently mod_jk 1.2.20 accept those packets, but don't send bigger 
> pakets then 8k ( see my separate posting).

Which is most likely useless.

> More memory is not a big argument. 8k is default, and only at spezial 
> case user use greater packetSize. Greater
> PacketSize means that you send fewer GET BODY messages. This reduce the 
> ajp handshake overhead.

People will need to use more than 8KB is they have a large cert chain, 
but will not benefit in any way from using larger packets on output 
other than using more memory. I don't understand why you are talking 
about "get body" messages since your changes are for output, not input. 
If you can provide data which shows a performance gain, then this could 
be considered.

So -1 for your changes (it's a definitive veto in 5.5 since it is the 
stable branch; I'm still against it in 6.0 unless you can prove it 
provides a significant benefit).

Rémy


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r486219 - /tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/connector/Response.java

Posted by Peter Rossbach <pr...@objektpark.de>.
Hi Remy,

Am 12.12.2006 um 17:57 schrieb Remy Maucherat:

> pero@apache.org wrote:
>> Author: pero
>> Date: Tue Dec 12 08:35:15 2006
>> New Revision: 486219
>> URL: http://svn.apache.org/viewvc?view=rev&rev=486219
>> Log:
>> Add support to send and receive more the 8K BODY packets.
>
> I'm not happy with that. There's some buffering taking place  
> already, as the output needs to be assembled into a buffer to be  
> able to do a single write (at least for the connectors in  
> org.apache.ajp, I didn't look at the one in org.apache.jk). As a  
> result, I think this would simply use more memory, and 8K is quite  
> efficient already.
>
> Rémy
>

Yes, but as I configured packetSize greater then 8k, I would like to  
see that ajp send those big chunks.
Currently mod_jk 1.2.20 accept those packets, but don't send bigger  
pakets then 8k ( see my separate posting).

More memory is not a big argument. 8k is default, and only at spezial  
case user use greater packetSize. Greater
PacketSize means that you send fewer GET BODY messages. This reduce  
the ajp handshake overhead.

Peter



Re: svn commit: r486219 - /tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/connector/Response.java

Posted by Remy Maucherat <re...@apache.org>.
pero@apache.org wrote:
> Author: pero
> Date: Tue Dec 12 08:35:15 2006
> New Revision: 486219
> 
> URL: http://svn.apache.org/viewvc?view=rev&rev=486219
> Log:
> Add support to send and receive more the 8K BODY packets.

I'm not happy with that. There's some buffering taking place already, as 
the output needs to be assembled into a buffer to be able to do a single 
write (at least for the connectors in org.apache.ajp, I didn't look at 
the one in org.apache.jk). As a result, I think this would simply use 
more memory, and 8K is quite efficient already.

Rémy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r486219 - /tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/connector/Response.java

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
-1 on using tabs instead of spaces ;)



pero@apache.org wrote:
> Author: pero
> Date: Tue Dec 12 08:35:15 2006
> New Revision: 486219
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=486219
> Log:
> Add support to send and receive more the 8K BODY packets.
>
> Modified:
>     tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/connector/Response.java
>
> Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/connector/Response.java
> URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/connector/Response.java?view=diff&rev=486219&r1=486218&r2=486219
> ==============================================================================
> --- tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/connector/Response.java (original)
> +++ tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/connector/Response.java Tue Dec 12 08:35:15 2006
> @@ -132,8 +132,24 @@
>          this.connector = connector;
>          if("AJP/1.3".equals(connector.getProtocol())) {
>              // default size to size of one ajp-packet
> -            outputBuffer = new OutputBuffer(8184);
> -        } else {
> +        	Object packetSize = (Object)connector.getProperty("packetSize") ;
> +        	int valuePacketSize = 8192 ;
> +        	if(packetSize != null) {
> +        		if (packetSize instanceof Integer) {
> +        			valuePacketSize =((Integer)packetSize).intValue();
> +				} else {
> +		       		if (packetSize instanceof String) {
> +		       			if(!"".equals(packetSize))
> +		       				valuePacketSize = new Integer((String)packetSize).intValue();
> +					}
> +				}       	    	   
> +        		if(valuePacketSize < 8192 )
> +        			valuePacketSize = 8192 ;
> +        	}
> +        	// Reduce HSIZE and Command = 6 Bytes
> +       		outputBuffer = new OutputBuffer(valuePacketSize - 6 );
> +
> +         } else {
>              outputBuffer = new OutputBuffer();
>          }
>          outputStream = new CoyoteOutputStream(outputBuffer);
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>
>
>   



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org