It is Tomcat 5.5.26

summarize all information which I have gathered so far from your answers it 
looks like a 
problem which seem to occur trhough a not-thread safe implementation of a class
or the whole servlet?

If this is the case I get some munition to go the the developers.
Thanks for all your help

- Uwe

-----Ursprüngliche Nachricht-----
Von: André Warnier [mailto:a...@ice-sa.com] 
Gesendet: Dienstag, 20. Dezember 2011 15:47
An: Tomcat Users List
Betreff: Re: How much connections are handled per thread?

uwe.hellm...@t-systems.com wrote:
> Hello together,
> 
> just a short question.
> Does a single Tomcat thread handle more than one connection at a time? (kind 
> of multiplexing)

Essentially, no.

One tomcat thread could be handling several successive *requests* on the same 
connection, 
one after the other, if KeepAlive is enabled.

But one thread will not handle multiple connections at the same time.

> Is it possible that if there are more connections at a time per thread that 
> there is a bug that
> a GET variable is exchanged between these connections?

You are not saying which version of Tomcat this is, which makes it hard to 
check if there 
ever was a bug in Tomcat in that respect.

It is far more likely that it is something in your application, which does 
something which 
is not thread-safe, and causes data to be in effect shared by various threads.
Or, something is accidentally being "remembered" by a thread which has 
processed a request 
from a browser, and is being re-used by the same thread to process a later 
request from 
another browser (and another connection).

Note that the same thread can /successively/ handle several connections, and 
that the same 
browser may be using over time several distinct connections with Tomcat.
That is not a contradiction with what I said above.

Examples :
1) a browser establishes a connection with tomcat, and sends one request to 
tomcat over 
that connection; then it waits for the response.  Tomcat allocates one thread 
to this new 
connection. The thread processes the request and sends the response.  The 
browser reads 
the response, and then he goes away and never asks for more.  After a while 
(maybe 
immediately if there is no KeepAlive), the thread will close the connection and 
become 
available again to process a new connection.  This new connection could be from 
the same 
browser, or not.
2) a browser establishes a connection with tomcat, and sends one request to 
tomcat over 
that connection; then it waits for the response.  Tomcat allocates one thread 
to this new 
connection. The thread processes the request and sends the response.  The 
browser reads 
the response, and sends another request over the same connection (because 
KeepAlive is 
on).  The same thread processes the second browser request and responds. This 
goes on as 
long as the browser is sending more requests on that connection, until the 
KeepAlive 
request limit is reached (maybe never, if there is no limit). When the limit is 
reached, 
the thread closes the connection and becomes available again for other 
connections.
If the browser wants to send more requests, it must create a new connection and 
send these 
requests over that new connection.  At the tomcat level, this would be 
processed by a new 
thread (which may by chance be the same as the first time, but that is 
unlikely).



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to