tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hector Gonzalez" <hgonza...@questionexchange.com>
Subject [PATCH] ThreadPool rewrite with sanity checks
Date Fri, 01 Jun 2001 20:33:33 GMT
Hi all,

After performing stress testing on Tomcat 3.2.2 I found that one area of
trouble was the Thread Pool. Long running servlets may eat up all resources
and
prevent tomcat from accepting any new connections on the socket. Also for
some still unknown reason performance would decrease over time.

I have patched the code to do perform two safety checks:

1. If a thread has been processing a request for too long (as specified in a
parameter) the thread is stoped.
2. After a thread has already processed X requests or more (X
TcpWorkerThreads have been attached), it is terminated and a new thread is
created.

I also changed the code and moved most synchronization from ThreadPool to
ObjectHASH (a fully synchronized hash table)

I tested the patched code with 60 threads from 3 different machines with
very
good results in terms of reliability and performance.

This patch involves changes to:

util/ThreadPool.java
util/ThreadPoolRunnable.java
service/PoolTcpEndPoint.java

Regards
Hector Gonzalez
hgonzalez@questionexchange.com

Mime
View raw message