You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by lightbulb432 <ve...@hotmail.com> on 2007/06/24 19:33:01 UTC

In-Process Tomcat

I read a few things that explained the difference (in configurations where
you must front Tomcat with Apache HTTPD) between in-process Tomcat and
out-of-process Tomcat, and have a couple of questions.

It said that in-process Tomcat will reduce latency (which I understand) but
decrease both stability and scalability - why will it decrease both of these
things?

How can you set up an in-process Tomcat? I couldn't find anything related at
http://tomcat.apache.org/connectors-doc/ or by doing a web search. Do both
options make use of the mod_jk connector to HTTPD, and it's just a matter of
configuring it appropriately, or does Tomcat somehow have to be compiled
into Apache, or something else?


In general, what conflicts arise from an integrated Tomcat and HTTPD setup,
whether in-process or not? Both Tomcat and HTTPD have configuration related
to URL rewriting, authorization/authentication, logging, etc. In general
terms, what's the most reasonable way to configure your integrated setup so
that the resulting installation doesn't leave security holes, or break due
to URL rewriting, or any other results? An strategies or best practices
here?
-- 
View this message in context: http://www.nabble.com/In-Process-Tomcat-tf3972772.html#a11276703
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
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: In-Process Tomcat

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: lightbulb432 [mailto:veerukrishnan@hotmail.com] 
> Subject: Re: In-Process Tomcat
> 
> You're actually the first person I've heard to say that apps 
> that need to scale would not use HTTPD. I've read the exact
> opposite on multiple occassions, but as I'm a relative newbie
> to Tomcat I'm hoping people on this mailing list can correct
> me. Could you expand on your point further?

Once upon a time, Tomcat was not terribly efficient at returning static
content, and that no longer valid perception persists, unfortunately
(first impressions, and all that).  Current levels of Tomcat show about
the same performance as httpd for static content.  Consequently, placing
httpd in front of Tomcat just to serve static content does not improve
response time for those requests, and has a significant negative impact
for dynamic requests due to the added path length.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
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: In-Process Tomcat

Posted by Leon Rosenberg <ro...@googlemail.com>.
On 6/25/07, lightbulb432 <ve...@hotmail.com> wrote:
>
>
> > You mention that when you use a static content server, it's generally
> >> something other that HTTPD. Is there a particular reason for that? What
> >> static servers have you generally seen in use apart from HTTPD - are
> >> there
> >> things that just work "better" in the setup you described than others?
> >
> > http://lighttpd.net/
>
> Without using hardware load balancers, how could you implement the
> architecture whereby (as you described) lighttpd serves static content,
> Tomcat serves dynamic content, but with the two sets of servers (lighttpd
> and Tomcat) in parallel rather than lighttpd fronting Tomcat?
>
> Would you be required to, in your JSPs, include all links to static content
> using http://staticserver.site.com/...?

That would be one very good option. I think ebay uses it and many
others. Another option would be for example puting a squid infront of
the tomcat and let it cache the static tomcat served by tomcat (and
any other cacheable content). Its almost the same as apache httpd
infront, but squid is faster in a number of things. However, I think
there are a lot of possible solutons, without knowing your usecase its
hard to pick one :-)

regards
Leon



>
> What are all the available options to implement this setup? Thanks.
> --
> View this message in context: http://www.nabble.com/In-Process-Tomcat-tf3972772.html#a11290376
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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: In-Process Tomcat

Posted by lightbulb432 <ve...@hotmail.com>.

> You mention that when you use a static content server, it's generally
>> something other that HTTPD. Is there a particular reason for that? What
>> static servers have you generally seen in use apart from HTTPD - are
>> there
>> things that just work "better" in the setup you described than others?
> 
> http://lighttpd.net/

Without using hardware load balancers, how could you implement the
architecture whereby (as you described) lighttpd serves static content,
Tomcat serves dynamic content, but with the two sets of servers (lighttpd
and Tomcat) in parallel rather than lighttpd fronting Tomcat?

Would you be required to, in your JSPs, include all links to static content
using http://staticserver.site.com/...? 

What are all the available options to implement this setup? Thanks.
-- 
View this message in context: http://www.nabble.com/In-Process-Tomcat-tf3972772.html#a11290376
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
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: In-Process Tomcat

Posted by Leon Rosenberg <ro...@googlemail.com>.
On 6/25/07, lightbulb432 <ve...@hotmail.com> wrote:
>
>
> Any web application that needs to scale wouldn't use httpd (or
> > anything else) in front of tomcat, so the question in- or out-process
> > tomcat doesn't matter. From 5 high performance application I know the
> > details of, 1 is still using apache in front; more out of habbit,
> > rather than by need. Others are using a hw loadbalancer in front of x
> > tomcat servers, and some servers for static content (which can be
> > apache httpd, but is mostly something different) which are parallel to
> > the tomcat servers. So the loadbalancer decides which server to ask
> > for specific content type.
>
> You're actually the first person I've heard to say that apps that need to
> scale would not use HTTPD. I've read the exact opposite on multiple
> occassions, but as I'm a relative newbie to Tomcat I'm hoping people on this
> mailing list can correct me. Could you expand on your point further?

I don't want to open this can of worms again, I think there were about
1000 discussions in the past, you should check the archives if you
want the details. Basically the anti-httpd fraction (which i belong
to) states: thats usage of httpd is

a) less secure than usage of tomcat
alone (at least it doesn't add any security cause requests are passed
along, and the last security issue was in the c code of mod_jk ->
httpd).

b) less performant, since you add another node which does nothing but
consumes time.

>
> How would hardware load balancers go about handling sticky sessions? Or
> would you have to design for a stateless web tier so that any Tomcat
> instance will do upon the next request?

HW loadbalancers can handle sticky sessions far better than apache.
You can stick it on cookies, path elements, source ip-adresses, page
content, load, colour of users hair....
On the minus side they start at 10K USD and you usually need 2 of them.


>
> You mention that when you use a static content server, it's generally
> something other that HTTPD. Is there a particular reason for that? What
> static servers have you generally seen in use apart from HTTPD - are there
> things that just work "better" in the setup you described than others?

http://lighttpd.net/


regards
Leon

---------------------------------------------------------------------
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: In-Process Tomcat

Posted by lightbulb432 <ve...@hotmail.com>.

Any web application that needs to scale wouldn't use httpd (or
> anything else) in front of tomcat, so the question in- or out-process
> tomcat doesn't matter. From 5 high performance application I know the
> details of, 1 is still using apache in front; more out of habbit,
> rather than by need. Others are using a hw loadbalancer in front of x
> tomcat servers, and some servers for static content (which can be
> apache httpd, but is mostly something different) which are parallel to
> the tomcat servers. So the loadbalancer decides which server to ask
> for specific content type.

You're actually the first person I've heard to say that apps that need to
scale would not use HTTPD. I've read the exact opposite on multiple
occassions, but as I'm a relative newbie to Tomcat I'm hoping people on this
mailing list can correct me. Could you expand on your point further?

How would hardware load balancers go about handling sticky sessions? Or
would you have to design for a stateless web tier so that any Tomcat
instance will do upon the next request?

You mention that when you use a static content server, it's generally
something other that HTTPD. Is there a particular reason for that? What
static servers have you generally seen in use apart from HTTPD - are there
things that just work "better" in the setup you described than others?
-- 
View this message in context: http://www.nabble.com/In-Process-Tomcat-tf3972772.html#a11288104
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
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: In-Process Tomcat

Posted by Leon Rosenberg <ro...@googlemail.com>.
On 6/25/07, lightbulb432 <ve...@hotmail.com> wrote:
>
> Thanks for your detailed response. See questions below.
>
>
> In-process Tomcat is to have Tomcat running in the same process space as
> > Apache HTTPD, IIS, or other web server.  Since most of the web servers
> > are implemented in C/C++, you will have to use JNI to integrate with
> > Java-based Tomcat, and create a "mod_tomcat" like module for Httpd.
>
> So there's no standard prepackaged installation of the two combined, or no
> standard "connector" plugin or something that's distributed with either
> Tomcat or HTTPD, which is why I'd have to create it myself? Is the
> in-process approach that uncommon?

personally i never heard of anyone using it.

>
>
> Definitely the in-process setup improves performance, since
> > communication between Tomcat and web server occurs via memory-based data
> > exchange.  It will be less stable since if something went wrong with the
> > Tomcat, it would affect the web server directly.  It will also be less
> > scalable, since this setup won't support high-availability and
> > clustering of Tomcat servers.
>
> Why does the in-process approach render high-availability and clustering
> impossible? From a technical/implementation perspective, what is it about
> the in-process approach that causes this specific functionality to not be
> possible?

I think the poster means that you can't loadbalance with an apache
between multiple tomcat instance, a clustering / fail-over technique
for low cost sites (say 2 or 3 webservers).

>
> In any case, if clustering features don't work then it's definitely no
> surprise that any web application that needs to scale wouldn't use this
> approach...unless it is being used in some way by such web applications in
> production - anybody know?

Any web application that needs to scale wouldn't use httpd (or
anything else) in front of tomcat, so the question in- or out-process
tomcat doesn't matter. From 5 high performance application I know the
details of, 1 is still using apache in front; more out of habbit,
rather than by need. Others are using a hw loadbalancer in front of x
tomcat servers, and some servers for static content (which can be
apache httpd, but is mostly something different) which are parallel to
the tomcat servers. So the loadbalancer decides which server to ask
for specific content type.

regards
Leon

> --
> View this message in context: http://www.nabble.com/In-Process-Tomcat-tf3972772.html#a11281236
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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: In-Process Tomcat

Posted by lightbulb432 <ve...@hotmail.com>.
Thanks for your detailed response. See questions below.


In-process Tomcat is to have Tomcat running in the same process space as
> Apache HTTPD, IIS, or other web server.  Since most of the web servers
> are implemented in C/C++, you will have to use JNI to integrate with
> Java-based Tomcat, and create a "mod_tomcat" like module for Httpd.

So there's no standard prepackaged installation of the two combined, or no
standard "connector" plugin or something that's distributed with either
Tomcat or HTTPD, which is why I'd have to create it myself? Is the
in-process approach that uncommon?


Definitely the in-process setup improves performance, since
> communication between Tomcat and web server occurs via memory-based data
> exchange.  It will be less stable since if something went wrong with the
> Tomcat, it would affect the web server directly.  It will also be less
> scalable, since this setup won't support high-availability and
> clustering of Tomcat servers.

Why does the in-process approach render high-availability and clustering
impossible? From a technical/implementation perspective, what is it about
the in-process approach that causes this specific functionality to not be
possible?

In any case, if clustering features don't work then it's definitely no
surprise that any web application that needs to scale wouldn't use this
approach...unless it is being used in some way by such web applications in
production - anybody know?
-- 
View this message in context: http://www.nabble.com/In-Process-Tomcat-tf3972772.html#a11281236
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
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: In-Process Tomcat

Posted by "Duan, Nick" <ND...@mcdonaldbradley.com>.
In-process Tomcat is to have Tomcat running in the same process space as
Apache HTTPD, IIS, or other web server.  Since most of the web servers
are implemented in C/C++, you will have to use JNI to integrate with
Java-based Tomcat, and create a "mod_tomcat" like module for Httpd. 

Definitely the in-process setup improves performance, since
communication between Tomcat and web server occurs via memory-based data
exchange.  It will be less stable since if something went wrong with the
Tomcat, it would affect the web server directly.  It will also be less
scalable, since this setup won't support high-availability and
clustering of Tomcat servers.

Out-process Tomcat, on the other hand, is running as an independent
server in a different process space or on a different machine as the
HTTPD server.  It may lack the performance as the in-process set up,
since the communication between Tomcat and HTTPD occurs via network.
But it is definitely more stable and more scalable than in-process
Tomcat. 

I don't think that in-process Tomcat is much used nowadays, since it is
hard to configure and very error-prone.  The common way of using Tomcat
with a front end HTTPD is the out-process one, since it is more flexibly
and easy to configure.  The common architecture is to have the front-end
HTTPD running in a DMZ, serving static pages, while one or more Tomcat
servers hosting the dynamic application running behind the firewall.  In
this case, the out-process Tomcat is the only option.

Hope this helps. 

ND

-----Original Message-----
From: lightbulb432 [mailto:veerukrishnan@hotmail.com] 
Sent: Sunday, June 24, 2007 1:33 PM
To: users@tomcat.apache.org
Subject: In-Process Tomcat


I read a few things that explained the difference (in configurations
where
you must front Tomcat with Apache HTTPD) between in-process Tomcat and
out-of-process Tomcat, and have a couple of questions.

It said that in-process Tomcat will reduce latency (which I understand)
but
decrease both stability and scalability - why will it decrease both of
these
things?

How can you set up an in-process Tomcat? I couldn't find anything
related at
http://tomcat.apache.org/connectors-doc/ or by doing a web search. Do
both
options make use of the mod_jk connector to HTTPD, and it's just a
matter of
configuring it appropriately, or does Tomcat somehow have to be compiled
into Apache, or something else?


In general, what conflicts arise from an integrated Tomcat and HTTPD
setup,
whether in-process or not? Both Tomcat and HTTPD have configuration
related
to URL rewriting, authorization/authentication, logging, etc. In general
terms, what's the most reasonable way to configure your integrated setup
so
that the resulting installation doesn't leave security holes, or break
due
to URL rewriting, or any other results? An strategies or best practices
here?
-- 
View this message in context:
http://www.nabble.com/In-Process-Tomcat-tf3972772.html#a11276703
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
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