tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Taglang, Guillaume" <Guillaume.Tagl...@paybox.net>
Subject RE: multi threading in tomcat
Date Sat, 11 Aug 2001 20:08:23 GMT

I have a servlet calculating the decimal x of PI: it takes about 5 min in
processor time.
I have a 2nd servlet just displaying some nice HTML stuff: it takes 1 second
processing time.
Mr X access the servlet 1. 5 seconds later mr Y access the servlet 2.
What do you think Mr Y is thinking about the performance of my application ?
...

Guillaume

> -----Original Message-----
> From: Byrom Robert-LRB005 [mailto:Robert.Byrom@invisix.com]
> Sent: Saturday, August 11, 2001 9:14 PM
> To: 'tomcat-dev@jakarta.apache.org'
> Subject: RE: multi threading in tomcat
> 
> 
> >The precise details depend on which version of Tomcat you're talking
> >about.  Here's how it works in Tomcat 4:
> >
> >* A single thread running HttpConnector is listening on whatever
> >  TCP/IP socket (say, 8080).
> >
> >* When an incoming socket connection is accepted, it is handed off
> >  to an HttpProcessor running on another thread (up to a configurable
> >  maximum number of threads) while the connector thread goes back
> >  and waits for another incoming connection.
> 
> This is a point I'm unclear about, ie adding more threads to 
> deal with requests, does it really improve overall 
> performance? Why not have a single thread waitting on on the 
> HttpConnector to service all requests , the code can be made 
> faster by reducing context switching and in addition make it 
> thread safe. I dont believe that Java threading can be used 
> to really boost performance, even if you're running the app 
> on a multi-processor. I'm not confident that threading in 
> java is useful for optimisation rather it just complicates 
> design and makes the application more buggy if it isnt crucial.
> 
> rob.
>  
> 

Mime
View raw message