Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Tools / March 2004

Tip: Looking for answers? Try searching our database.

Apache http Server + Resin/Tomcat

Thread view: 
Roedy Green - 26 Mar 2004 21:44 GMT
I have seen that Resin or Tomcat can be used in conjunction with
Apache HTTP server.  Yet Resin is quite capable of serving HTTP on its
own.  What does Apache do that makes it worthwhile to horse around
with two servers?

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Henrik Eiriksson - 26 Mar 2004 22:06 GMT
I run heavy load production image-archive sites based on apache/tomcat and
it pays off to put apache in front of tomcat to offload all the static
content (thumbnails/images and such).

So: I would do the apache/tomcat (or resin) duo if you want to run a site
with some dynamic functionality and alot of static content (such as images
& raw html pages). For an all-out dynamic site you might just as well run
tomcat or resin standalone.

> I have seen that Resin or Tomcat can be used in conjunction with
> Apache HTTP server.  Yet Resin is quite capable of serving HTTP on its
[quoted text clipped - 5 lines]
> Coaching, problem solving, economical contract programming.
> See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
David Rabinowitz - 28 Mar 2004 09:11 GMT
Bear in mind that current sites rely greatly on static content such as
css files, JavaScript files and (planty of) images. I find it hard to
believe that Tomcat or Resin will do better job than Apache. Also, don't
you want to save the JVM's CPU and memory fo dymanic content rather than
static one?

I's suggest to do a small benchmark - see what is the porformance
difference between the options (It would be also nice to hear about your
impressions of the two settings).

David

> I run heavy load production image-archive sites based on apache/tomcat and
> it pays off to put apache in front of tomcat to offload all the static
[quoted text clipped - 14 lines]
>>Coaching, problem solving, economical contract programming.
>>See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Robert Klemme - 29 Mar 2004 13:57 GMT
> Bear in mind that current sites rely greatly on static content such as
> css files, JavaScript files and (planty of) images. I find it hard to
> believe that Tomcat or Resin will do better job than Apache.

Nobody claimed that.  The claim was in fact the other way round: Apache is
better at serving static content.  But you need Tomcat / Resin for the
dynamic part if that is to be done in JSP / Servlet technology.

> Also, don't
> you want to save the JVM's CPU and memory fo dymanic content rather than
> static one?

Err, the CPU is the same as that of the Apache. :-)  And memory overhead
is not that much for static content (it's streamed).  All in all IMHO
Henrik is completely right to suggest to use the tandem only for heavy
load sites.  Tomcat / Resin are not that bad at serving static content;
after all, that is mostly IO bound and that depends on the OS, disks and
network connection.  Same for Apache and Tomcat.

> I's suggest to do a small benchmark - see what is the porformance
> difference between the options (It would be also nice to hear about your
> impressions of the two settings).

It's always a good idea to do benchmarking to have concrete numbers for
comparison.  Note however that it is not too easy to simulate a high
traffic web site.  The benchmark itself can get complicated and expensive
soon.

Regards

   robert

> David
>
[quoted text clipped - 16 lines]
> >>Coaching, problem solving, economical contract programming.
> >>See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Mohun Biswas - 29 Mar 2004 15:18 GMT
> "David Rabinowitz" <dar@cs.huji.ac.il> schrieb im Newsbeitrag
>>Also, don't
>>you want to save the JVM's CPU and memory fo dymanic content rather than
>>static one?
>
> Err, the CPU is the same as that of the Apache. :-)

Actually there's no requirement that the two servers run on the same
machine, let alone the same CPU.

MB
Robert Klemme - 29 Mar 2004 15:53 GMT
> > "David Rabinowitz" <dar@cs.huji.ac.il> schrieb im Newsbeitrag
> >>Also, don't
[quoted text clipped - 5 lines]
> Actually there's no requirement that the two servers run on the same
> machine, let alone the same CPU.

Oops, yeah that's true.  Thanks for correcting that!

   robert
David Rabinowitz - 29 Mar 2004 16:51 GMT
>>Bear in mind that current sites rely greatly on static content such as
>>css files, JavaScript files and (planty of) images. I find it hard to
[quoted text clipped - 3 lines]
> better at serving static content.  But you need Tomcat / Resin for the
> dynamic part if that is to be done in JSP / Servlet technology.

As I see it, the claim was in the opinion that can drop Apache from the
system.

>>Also, don't
>>you want to save the JVM's CPU and memory fo dymanic content rather than
[quoted text clipped - 6 lines]
> after all, that is mostly IO bound and that depends on the OS, disks and
> network connection.  Same for Apache and Tomcat.

Not exactly - Apache, written in C, will be faster than Java serving
static content. Also, why waste a tomcat working thread (forgot to
mention it earlier...) on static content?

>>I's suggest to do a small benchmark - see what is the porformance
>>difference between the options (It would be also nice to hear about your
[quoted text clipped - 4 lines]
> traffic web site.  The benchmark itself can get complicated and expensive
> soon.

So I guess we are all waiting anxiously ;-) Does anybody wants to peek
the glove?

David
Mohun Biswas - 29 Mar 2004 17:37 GMT
> As I see it, the claim was in the opinion that can drop Apache from the
> system.

The record is quite clear. He said "For an all-out dynamic site you
might just as well run tomcat or resin standalone". Meaning that Apache
cannot help you with dynamic java-based resources. There's nothing to
argue with here; it's just plain true.

MB
Mohun Biswas - 29 Mar 2004 17:49 GMT
>> As I see it, the claim was in the opinion that can drop Apache from
>> the system.
[quoted text clipped - 3 lines]
> cannot help you with dynamic java-based resources. There's nothing to
> argue with here; it's just plain true.

Also, from the Resin website
(http://www.caucho.com/resin-3.0/install/httpd.xtp):

> Resin provides a fast standalone web server. In our benchmarks, it serves static pages faster than Apache!

(I have not independently evaluated this claim, nor ever used resin for
that matter).

MB
Jon A. Cruz - 29 Mar 2004 18:46 GMT
> Not exactly - Apache, written in C, will be faster than Java serving
> static content. Also, why waste a tomcat working thread (forgot to
> mention it earlier...) on static content?

If you're basing the speed issue on having been written in C, that's not
really a good measurement. More depends on the networking and *how* the
app was written, not which language it was written in.
Robert Klemme - 30 Mar 2004 13:58 GMT
> >>Bear in mind that current sites rely greatly on static content such as
> >>css files, JavaScript files and (planty of) images. I find it hard to
[quoted text clipped - 6 lines]
> As I see it, the claim was in the opinion that can drop Apache from the
> system.

... if and only if the amount of static content served is considerable
small compared to the dynamic content.  That was the claim.  I added that
the crucial factor in serving static content is disk speed, the filesystem
and network bandwidth - not so much the language or technology used to
implement the server.

> Not exactly - Apache, written in C, will be faster than Java serving
> static content.

Not necessarily (see above).

> Also, why waste a tomcat working thread (forgot to
> mention it earlier...) on static content?

Why not?  A tomcat thread is cheaper than a complete Apache process.

   robert
Roedy Green - 29 Mar 2004 21:32 GMT
>I have seen that Resin or Tomcat can be used in conjunction with
>Apache HTTP server.  Yet Resin is quite capable of serving HTTP on its
>own.  What does Apache do that makes it worthwhile to horse around
>with two servers?

What I meant by my original question is why is Apache so much better
at handling static content than Resin that the hassle of
intercommunication between the two pays off?

What clever techniques does it use to handle static content so well?

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.