You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Carlos Rodríguez Colino <ca...@tid.es> on 2003/06/26 13:49:23 UTC

decrease idle threads in the pool faster...

	Hi all...

	I have just installed Tomcat 4.1 on a Solaris box and I have realized a
surprising effect: Thread pool creates new threads quickly when a
request burst arrives, but the freeing when they become idle is very
slow (besides, the computer is almost full cpu loaded). Due to this,
several bursts carry out reaching the max number of processes, and
Tomcat stops working.

	My intention is to force idle recent-used threads (lwp in Solaris) to
be killed in a shorter period of time in order to mantain almost
constant the number of lwps in the pool. So, I was going to dive into
CoyoteConnector code to discover and decrease any freeing timeout of the
idle threads, but perhaps some of you can guide me better to get what I
need.

	Thanks in advance and best regards,

	Carlos Rodríguez

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: decrease idle threads in the pool faster...

Posted by Ronald Klop <ro...@base.nl>.
Carlos Rodríguez Colino wrote:
> 	Hi all...
> 
> 	I have just installed Tomcat 4.1 on a Solaris box and I have realized a
> surprising effect: Thread pool creates new threads quickly when a
> request burst arrives, but the freeing when they become idle is very
> slow (besides, the computer is almost full cpu loaded). Due to this,
> several bursts carry out reaching the max number of processes, and
> Tomcat stops working.
> 
> 	My intention is to force idle recent-used threads (lwp in Solaris) to
> be killed in a shorter period of time in order to mantain almost
> constant the number of lwps in the pool. So, I was going to dive into
> CoyoteConnector code to discover and decrease any freeing timeout of the
> idle threads, but perhaps some of you can guide me better to get what I
> need.

I didn't look in the code recently, but doesn't the threads do a wait() 
and get a notify() when there is a new request/connection?
In that case you can do a wait(timeout) and after wait returns check if 
it is woken up for a new request/connection or because of the timeout. 
If it's the timeout, you can end the thread.

Just a thought.

Greetings,
Ronald.



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org