You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Remy Maucherat <re...@exoffice.com> on 2000/05/22 19:46:54 UTC

[Catalina] Commit message

I successfully commited some stuff related to the new connector yesterday in
the CVS. However, it seems that the commit message was not sent for some
reason, so I include it in this message.

Here is the first draft at a HTTP/1.1 connector.

It's very tightly based on Craig's test connector. It adds

persistent connection support, which work either with

HTTP/1.0 or HTTP/1.1. The behavior is a bit different

depending on the version of HTTP used.

The modified connector has been tested with :

- IE 5.01

- Mozilla

- Apache JMeter

JMeter test yielded very good results (not because of the

keep alive feature, but because of Craig's connector very

good performace), and the connector seems reliable and fast

(it's 2-3 times faster than Tomcat 3.2 dev for static pages).

I modified RequestStream and ResponseStream and made

them non-final, so that a subclass can transparently perform

chunking.

Known issues :

- Some broken pipes exceptions are loggued. This is normal

behavior in HTTP/1.1, so I'll remove the logging in that

particular case.

- Idle processors will need to be put back in the pool. A new

background thread will perform that task

- Dynamic content (JSP and servlets) doesn't work very well

right now, mainly because I have to use chunking (which is

not implemented right now)

- All the other HTTP/1.1 stuff (headers ...) has yet to be done

Remy



Re: Serving Static Pages (was Re: [Catalina] Commit message)

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
guru@edamame.stinky.com wrote:

> On Mon, May 22, 2000 at 11:37:51AM -0700, Remy Maucherat wrote:
> > > > (it's 2-3 times faster than Tomcat 3.2 dev for static pages).
> > >
> > > :-)
> > > It was never a goal for tomcat 3.2 to be fast on serving static
> > > pages. Have you compared it with Apache ( or IIS or NES ) :-)?
> >
> > Hehe.
> >
> > > The "standalone" mode in tomcat 3.2 was not intended for
> > > high-performance, stand-alone use - static files in tomcat
> > > are handled by a real server.
>
> Correct me if I'm wrong, but doesn't the whole webapp architecture
> mean that if I deploy my application as a WAR file in the
> TOMCAT/webapps/ directory, then Tomcat will be required to serve all
> the static pages in there as well?  Isn't that a big performance deal?
>

If you run Tomcat stand-alone (as many people do) or embedded in an app
server where it is the web service component (as more and more people will
do as Tomcat gets embedded in app servers), then yes this is a big deal.

If you run behind a web server (as many people do), it's not so big a deal
(although the HTTP protocol implementation is only part of the issue of
what makes servlet containers faster or slower).

The important point IMHO is that both populations exist, and both their
needs should be considered important.

>
> I imagine that clever Apache rewrite rules can take care of the case
> where the webapp has been unpacked (not living in a WAR file), but
> even so, the default configuration sends all requests under a given
> context to Tomcat as well.
>

The user's guide that comes with Tomcat tells you how to arrange for
Apache to serve static files, and only call Tomcat for servlets and JSP
pages.  It doesn't really take clever rewrite rules -- just path and
extension matching.

By the way ... Tomcat always unpacks WAR files before using them -- the
code that used to allow it to execute out of WAR files was removed, and is
probably going to need to be put back to meet functional requirements when
Tomcat is integrated into development tools.

>
>  - Alex
>

Craig McClanahan



Re: Serving Static Pages (was Re: [Catalina] Commit message)

Posted by co...@costin.dnt.ro.
> Correct me if I'm wrong, but doesn't the whole webapp architecture
> mean that if I deploy my application as a WAR file in the
> TOMCAT/webapps/ directory, then Tomcat will be required to serve all
> the static pages in there as well?  Isn't that a big performance deal?

> I imagine that clever Apache rewrite rules can take care of the case
> where the webapp has been unpacked (not living in a WAR file), but
> even so, the default configuration sends all requests under a given
> context to Tomcat as well.

Not quite - Apache will serve the static content ( if you use the right
configuration ). What you start tomcat it will generate a config fragment
for apache that you can include in your httpd.conf.

We need a lot of work in this area - automatic the configuration,
restarting the server when a new webapp is deployed, etc. In other words -
a deploy tool. Now it works - all the fancy tools and config is left to
the reader :-)

Costin



Serving Static Pages (was Re: [Catalina] Commit message)

Posted by gu...@edamame.stinky.com.
On Mon, May 22, 2000 at 11:37:51AM -0700, Remy Maucherat wrote:
> > > (it's 2-3 times faster than Tomcat 3.2 dev for static pages).
> >
> > :-)
> > It was never a goal for tomcat 3.2 to be fast on serving static
> > pages. Have you compared it with Apache ( or IIS or NES ) :-)?
> 
> Hehe.
> 
> > The "standalone" mode in tomcat 3.2 was not intended for
> > high-performance, stand-alone use - static files in tomcat
> > are handled by a real server.

Correct me if I'm wrong, but doesn't the whole webapp architecture
mean that if I deploy my application as a WAR file in the
TOMCAT/webapps/ directory, then Tomcat will be required to serve all
the static pages in there as well?  Isn't that a big performance deal?

I imagine that clever Apache rewrite rules can take care of the case
where the webapp has been unpacked (not living in a WAR file), but
even so, the default configuration sends all requests under a given
context to Tomcat as well.

 - Alex

Re: [Catalina] Commit message

Posted by co...@costin.dnt.ro.
> I like 100% Java solutions.
> In some, it doesn't make sense performance wise, but if you have a fast
> enough server (and given the recent improvements in JVM technology thanks to
> IBM and Sun) we should make sure it provides a decent solution.

I also like 100% Java solutions - but today most people prefer to 
use Apache as web server ( I have no idea why, but it seems to be 
a fact ). 


> I don't really know (ask Craig). I had a quick look at the connector APIs
> and interfaces in Tomcat (TCPConnection and others), and we don't use them,
> so it might not be easy to fit the new connectors in the Tomcat 3.x
> architecture.

I'm only talking about the HTTP/1.1 code - tomcat 3.2 has very good and
reusable thread pool and socket code - the only change will be to remove
the the code that is duplicated, and keep the http/1.1
implementation. It's not difficult - if there is wish to share and reuse 
code. 

I did it once for the session management code, and the hard part was to
remove all the interfaces from catalina. ( of course, the code changed
in both projects, so probably we'll need a new "integration" - probably
harder this time since catalina 'evolved' to more even interfaces ).


Costin



Re: [Catalina] Commit message

Posted by Remy Maucherat <re...@exoffice.com>.
> > (it's 2-3 times faster than Tomcat 3.2 dev for static pages).
>
> :-)
> It was never a goal for tomcat 3.2 to be fast on serving static
> pages. Have you compared it with Apache ( or IIS or NES ) :-)?

Hehe.

> The "standalone" mode in tomcat 3.2 was not intended for
> high-performance, stand-alone use - static files in tomcat
> are handled by a real server.

I like 100% Java solutions.
In some, it doesn't make sense performance wise, but if you have a fast
enough server (and given the recent improvements in JVM technology thanks to
IBM and Sun) we should make sure it provides a decent solution.

> Of course, it will be great to have a 1.1 connector in 3.2 -
> any particular reason for keeping the HTTP1/1 only in Catalina
> workspace ?
> Is someone allowed to adapt it to 3.2, or it
> is a catalina-only component ( i.e. works only with catalina) ?

> AFAIK the http connector is supposed to implement the http
> protocol and extract the informations needed by the servlet
> engine - it shouldn't depend on the architecture of the
> engine ( except few small details - request/response creation
> and the initial invocation - easy to adapt )

I don't really know (ask Craig). I had a quick look at the connector APIs
and interfaces in Tomcat (TCPConnection and others), and we don't use them,
so it might not be easy to fit the new connectors in the Tomcat 3.x
architecture.

Remy


Re: [Catalina] Commit message

Posted by co...@costin.dnt.ro.
> (it's 2-3 times faster than Tomcat 3.2 dev for static pages).

:-)
It was never a goal for tomcat 3.2 to be fast on serving static
pages. Have you compared it with Apache ( or IIS or NES ) :-)? 

The "standalone" mode in tomcat 3.2 was not intended for 
high-performance, stand-alone use - static files in tomcat
are handled by a real server.

Of course, it will be great to have a 1.1 connector in 3.2 -
any particular reason for keeping the HTTP1/1 only in Catalina 
workspace ? Is someone allowed to adapt it to 3.2, or it 
is a catalina-only component ( i.e. works only with catalina) ?

AFAIK the http connector is supposed to implement the http
protocol and extract the informations needed by the servlet
engine - it shouldn't depend on the architecture of the 
engine ( except few small details - request/response creation
and the initial invocation - easy to adapt )

Costin