tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Tomcat thread pool question
Date Wed, 10 Dec 2008 22:23:00 GMT
Hash: SHA1


ped wrote:
> I would think that I should be able to increase the number of threads
> available to Tomcat to prevent this problem (I'm not saying that is the
> correct solution to my problem - I fully understand that our design is the
> root of this problem). 

If you have many clients:

1. borrowing db connections
2. executing queries
3. committing transactions and returning the connections to the pool

...then you have very nondeterministic behavior.

If every request requires a db connection (either from the pool, or from
the session, or wherever you store it), and you have fewer db
connections available than the number of processing threads configured,
then everything will eventually go to hell. Here's how:

1. Many clients borrow connections from the dbcp, exhausting it
2. New clients requiring new borrowed connections /block/ waiting for
   those pooled connections to be available
3. The requests blocked in #2 prevent new requests from being serviced
4. Clients who already "own" pooled connections cannot successfully
   make requests that will ultimately re-populate your dbcp

So, unless you have maxActive == dbcp size, you're screwed.

- -chris
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message