You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by André Warnier <aw...@ice-sa.com> on 2008/06/24 14:15:59 UTC

general info on proxying, load balancing, connectors

Hi.

I am a total ignorant in these questions, just looking for some basic 
pointers.  Neither do I need proxying or load balancing at the moment, 
or at least I don't think I do. So this is not urgent in any way.

But I do have some applications that work with an Apache front-end, 
delegating to a Tomcat back-end for some URLs, via mod_jk.  So I do 
understand the basics of proxying, connectors, load balancing etc..

In a very general sense, I think I also understand from some previous 
readings elsewhere and in this forum, that if you have a configuration 
with an Apache front-end server and one or more Tomcat back-ends, you 
can use 3 different methods to handle some content directly in Apache 
and other content with Tomcat(s) :

1) use Apache as a HTTP proxy, and proxy some requests via HTTP to 
back-end Tomcats, using the HTTP connector of Tomcat.

2) use mod_proxy_ajp at the Apache level to forward some requests to 
Tomcat, using the AJP connector of Tomcat

3) use mod_jk at the Apache level to forward some requests to Tomcat, 
using the AJP connector of Tomcat

And my question is : are there specific reasons or scenarios in which 
one of the above methods is preferable to the others ?

A very rough general answer would already help me seeing a bit more 
clearly where to look for more information.

Thanks in advance,
André

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


Re: general info on proxying, load balancing, connectors

Posted by André Warnier <aw...@ice-sa.com>.
Thanks, that's the kind of info I was looking for.

Christopher Schultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> André,
> 
> André Warnier wrote:
> | 1) use Apache as a HTTP proxy, and proxy some requests via HTTP to
> | back-end Tomcats, using the HTTP connector of Tomcat.
> |
> | 2) use mod_proxy_ajp at the Apache level to forward some requests to
> | Tomcat, using the AJP connector of Tomcat
> |
> | 3) use mod_jk at the Apache level to forward some requests to Tomcat,
> | using the AJP connector of Tomcat
> |
> | And my question is : are there specific reasons or scenarios in which
> | one of the above methods is preferable to the others ?
> 
> Yes. I'm not sure about the choice between AJP and HTTP, honestly. I
> think you'll find some people who think that HTTP proxying is faster
> because the server doesn't have to translate HTTP to AJP and back -- the
> request and response are essentially passed-through without modification
> (except whatever modifications you have configured ;).
> 
> Asa for mod_proxy_ajp versus mod_jk, there are a few reasons why you
> might want to choose one over the other:
> 
> Cases for mod_proxy_ajp:
> 
> 1. Comes bundled with Apache httpd, so there's no additional software to
> download, configure, compile, and then configure again.
> 
> 2. All configuration goes into httpd.conf (or your wherever your virtual
> host settings are) instead of into a separate file(*)
> 
> 3. Simple configurations are very simple to set up. Just want all
> traffic with a specific prefix to go to Tomcat? It's a simple one-liner.
> 
> (*) more recent versions of mod_jk have Apache configuration directives
> available so you don't /have/ to use workers.properties
> 
> Cases for mod_jk:
> 
> 1. If you are using Apache httpd versions before 2.2, you can't use
> mod_proxy_ajp because it's not available until 2.2
> 
> 2. Complex configurations are easier (IMO) using mod_jk. I have 3
> applications, two of which use the same URL space and I was unable to
> get mod_proxy_ajp configured to do everything I wanted it to do.
> 
> 3. I believe mod_jk is the only one that supports load balancing and
> failover. It's possible that mod_proxy_ajp supports this directly, or
> that Apache httpd has other modules that can effectively achieve the
> same goal, but I haven't really looked into it lately.
> 
> Hope that helps,
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iEYEARECAAYFAkhg+bQACgkQ9CaO5/Lv0PDuTwCfercxAj//GhOopdsozxrB7Umx
> wx8AoL0D46f09ot8Xc/Wxkd7NiSMn2Mo
> =5z8Z
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

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


Re: general info on proxying, load balancing, connectors

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

André,

André Warnier wrote:
| 1) use Apache as a HTTP proxy, and proxy some requests via HTTP to
| back-end Tomcats, using the HTTP connector of Tomcat.
|
| 2) use mod_proxy_ajp at the Apache level to forward some requests to
| Tomcat, using the AJP connector of Tomcat
|
| 3) use mod_jk at the Apache level to forward some requests to Tomcat,
| using the AJP connector of Tomcat
|
| And my question is : are there specific reasons or scenarios in which
| one of the above methods is preferable to the others ?

Yes. I'm not sure about the choice between AJP and HTTP, honestly. I
think you'll find some people who think that HTTP proxying is faster
because the server doesn't have to translate HTTP to AJP and back -- the
request and response are essentially passed-through without modification
(except whatever modifications you have configured ;).

Asa for mod_proxy_ajp versus mod_jk, there are a few reasons why you
might want to choose one over the other:

Cases for mod_proxy_ajp:

1. Comes bundled with Apache httpd, so there's no additional software to
download, configure, compile, and then configure again.

2. All configuration goes into httpd.conf (or your wherever your virtual
host settings are) instead of into a separate file(*)

3. Simple configurations are very simple to set up. Just want all
traffic with a specific prefix to go to Tomcat? It's a simple one-liner.

(*) more recent versions of mod_jk have Apache configuration directives
available so you don't /have/ to use workers.properties

Cases for mod_jk:

1. If you are using Apache httpd versions before 2.2, you can't use
mod_proxy_ajp because it's not available until 2.2

2. Complex configurations are easier (IMO) using mod_jk. I have 3
applications, two of which use the same URL space and I was unable to
get mod_proxy_ajp configured to do everything I wanted it to do.

3. I believe mod_jk is the only one that supports load balancing and
failover. It's possible that mod_proxy_ajp supports this directly, or
that Apache httpd has other modules that can effectively achieve the
same goal, but I haven't really looked into it lately.

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkhg+bQACgkQ9CaO5/Lv0PDuTwCfercxAj//GhOopdsozxrB7Umx
wx8AoL0D46f09ot8Xc/Wxkd7NiSMn2Mo
=5z8Z
-----END PGP SIGNATURE-----

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