jboss/tomcat - do i need a webserver?

R

RobR

I'm just curious, in previous companies I've worked with, the architecture
is
always jboss/tomcat, mod_jk and apache (or IIS). If I'm not serving up
any non jboss static html, do i really need a webserver beyond tomcat?
Adding in apache or IIS makes the whole thing much more complex
and if it's not necessary for a production level application, I'd like to
consider simplifying things. Thanks!
 
C

Chris Smith

RobR said:
I'm just curious, in previous companies I've worked with, the architecture
is always jboss/tomcat, mod_jk and apache (or IIS). If I'm not serving up
any non jboss static html, do i really need a webserver beyond tomcat?

Nope, you don't need a web server. Tomcat is perfectly capable of
serving HTTP. The need for Apache can arise from:

1. Performance. If a high portion of the content is static, then it is
likley to be faster to let Apache serve that content rather than Tomcat.
However, be careful about doing this for performance reasons if in fact
most of the content is dynamic, as it can be slower instead.

2. Flexibility. There exist a large number of extensions to Apache that
provide flexibility that's not available in Tomcat. For example, you
could use mod_rewrite to play all sorts of nasty tricks.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
R

RobR

Chris Smith said:
Nope, you don't need a web server. Tomcat is perfectly capable of
serving HTTP. The need for Apache can arise from:

1. Performance. If a high portion of the content is static, then it is
likley to be faster to let Apache serve that content rather than Tomcat.
However, be careful about doing this for performance reasons if in fact
most of the content is dynamic, as it can be slower instead.

2. Flexibility. There exist a large number of extensions to Apache that
provide flexibility that's not available in Tomcat. For example, you
could use mod_rewrite to play all sorts of nasty tricks.

Thanks for the quick response, I appreciate the info. The application
is using AJAX and is almost entirely dynamic so this is great news.
I finally got it working with IIS yesterday. I was so intent on the fact
that 'this is the way it's always been done', I didn't stop to ask myself
WHY. There is one other thing I just thought about though.... eventually
we will incorporate credit card transactions and will need do deal with
SSL certs. I'll have to read up to see if Tomcat can deal with that, but
it's not something I need to worry about for the next few months.
 
C

Chris Smith

RobR said:
Thanks for the quick response, I appreciate the info. The application
is using AJAX and is almost entirely dynamic so this is great news.
I finally got it working with IIS yesterday. I was so intent on the fact
that 'this is the way it's always been done', I didn't stop to ask myself
WHY. There is one other thing I just thought about though.... eventually
we will incorporate credit card transactions and will need do deal with
SSL certs. I'll have to read up to see if Tomcat can deal with that, but
it's not something I need to worry about for the next few months.

It works fine. Design-a-Course (from my signature, the product I
maintain for a living) runs on Tomcat under SSL. We've had no problems.
It's a little more of a hassle to update the certificates once they
expire, since you have to generate a new CSR. Overall, though, it's
pretty straight-forward.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
C

Chris Uppal

Chris said:
1. Performance. If a high portion of the content is static, then it is
likley to be faster to let Apache serve that content rather than Tomcat.

Is that something you know from personal experience (or other reputable source)
? I get the impression that Apache is pretty slow. At least, I can't think of
a webserver that doesn't proudly proclaim itself to be "faster than Apache"[*],
so I wonder whether Tomcat is actually slower for static content.

-- chris

([*] Including, IIRC, the very first webserver written in Java, back when only
the interpreter was available. Admitedly they didn't claim it to be /much/
faster, and also had to do quite a lot of performance work on Strings,
StringBuffers, and avoiding unwantedly synchronised methods in general.)
 
C

Chris Smith

Chris Uppal said:
Is that something you know from personal experience (or other reputable source)
? I get the impression that Apache is pretty slow. At least, I can't think of
a webserver that doesn't proudly proclaim itself to be "faster than Apache"[*],
so I wonder whether Tomcat is actually slower for static content.

I'm sure that it depends on context. I've definitely seen Apache (2.0
IIRC) perform faster than Tomcat under very heavy load. The 1.x release
cycle used to suffer from fairly serious performance problems under high
load, though.

I think there are several reasons besides Apache's slowness that
everyone claims to be faster than Apache:

- Apache is the de facto standard web server, running on a fair majority
of servers, so a lot of servers go out of their way to establish
advantages over it.

- Tuning plays a big role in performance of something like Apache.
Proper choice of filesystem and various parameters can be used to make
anything faster than anything else, so it's easy to establish being
faster.

Of course, I'd recommend anyone do some load testing if they are seeing
high enough load to care whether they're getting optimal performance out
of the web server.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,216
Latest member
Best cryptoconsultant

Latest Threads

Top