You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by John Baker <jb...@javasystemsolutions.com> on 2011/04/01 12:15:10 UTC

mod_jk / AJP and compression

Hello,

The Tomcat AJP Connector does not support compression. Why has this been
ommitted? 

Of course, Apache can do compression but this leaves data running
uncompressed between Apache and Tomcat.


John

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


RE: mod_jk / AJP and compression

Posted by "Holle, Jess" <je...@ptc.com>.
If you want compression here, then just do it in a servlet filter based on Accept-Encoding thus resulting in compression in Tomcat and the stream remaining compressed all the way to the client.

________________________________

From: Mark Thomas [mailto:markt@apache.org]
Sent: Fri 4/1/2011 5:20 AM
To: Tomcat Users List
Subject: Re: mod_jk / AJP and compression



On 01/04/2011 11:15, John Baker wrote:
> Hello,
>
> The Tomcat AJP Connector does not support compression. Why has this been
> ommitted?

Because the link between Tomcat and reverse proxy will nearly always
have significantly more capacity than the link between the client and
the reverse proxy. Adding compression gains very little but adds delay
and increases CPU usage.

Mark



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





Re: mod_jk / AJP and compression

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John,

On 4/1/2011 6:45 AM, John Baker wrote:
> In general, that's true. However, for high performance applications
> measuring results in milliseconds - ie noting that a request with
> compression takes 60ms and without takes 120ms - it's an issue. And it
> seems so easy to fix by putting compression into the Tomcat AJP
> connector. Given it's a quick fix, I was curious to why it hadn't been
> done before now?

It's not just a quick-fix: AJP is a binary protocol and simply
compressing it isn't fair to clients that wouldn't understand the
compression.

Regarding achieving compression, you have several options already. One
thing to note is that if httpd and Tomcat are on the same machine, you
are only wasting your time. With that out of the way, you have (at
least) the following options:

1. Use stunnel/ssh/etc with compression enabled. This has the
   advantage of also encrypting communications which you might want
   to do if you have components sending sensitive information across
   the network. Making sure the connection is always up might
   be a challenge, though.

2. Use your favorite VPN. These usually allow both encryption (or not)
   and compression (or not) and are generally pretty good about keeping
   themselves up and running so your app doesn't fail when it can't
   communicate.

3. Use mod_proxy_http and forget all about AJP entirely. AFAIK, all the
   HTTP connectors support compression.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2V6F4ACgkQ9CaO5/Lv0PB+4wCfXZo0SXKtdUuB+3B9+LFGyhkG
HSgAn20IDgQiRrdinTejDEQgSsnpKpxW
=E+p5
-----END PGP SIGNATURE-----

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


Re: mod_jk / AJP and compression

Posted by John Baker <jb...@javasystemsolutions.com>.
Mark,

In general, that's true. However, for high performance applications
measuring results in milliseconds - ie noting that a request with
compression takes 60ms and without takes 120ms - it's an issue. And it
seems so easy to fix by putting compression into the Tomcat AJP
connector. Given it's a quick fix, I was curious to why it hadn't been
done before now?


John

On Fri, 01 Apr 2011 11:20 +0100, "Mark Thomas" <ma...@apache.org> wrote:
> On 01/04/2011 11:15, John Baker wrote:
> > Hello,
> > 
> > The Tomcat AJP Connector does not support compression. Why has this been
> > ommitted?
> 
> Because the link between Tomcat and reverse proxy will nearly always
> have significantly more capacity than the link between the client and
> the reverse proxy. Adding compression gains very little but adds delay
> and increases CPU usage.
> 
> Mark
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 

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


Re: mod_jk / AJP and compression

Posted by Mark Thomas <ma...@apache.org>.
On 01/04/2011 11:15, John Baker wrote:
> Hello,
> 
> The Tomcat AJP Connector does not support compression. Why has this been
> ommitted?

Because the link between Tomcat and reverse proxy will nearly always
have significantly more capacity than the link between the client and
the reverse proxy. Adding compression gains very little but adds delay
and increases CPU usage.

Mark



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