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

2003-07-02 Thread Ronald Klop
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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

2003-07-02 Thread Minimalist Manager
ERROR:
There is no such list IDLE here.

SOLUTION:
Send a message to [EMAIL PROTECTED] with a subject
of 'info' (no quotes) for a list of available mailing lists.

-- 
Sincerely, the Minimalist

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



decrease idle threads in the pool faster... (II)

2003-06-30 Thread Carlos Rodríguez Colino

Hi everybody

I have been searching previous mails about killing idle threads, and I
found lots of them describing the same problem (lots of requests carry
out new threads that never are released, so, in a long-term, max number
of proccesses is reached and Tomcat stops). Some surprising answers were
such as:

Yes, no attempt is being made at killing processing threads that
werecreated. OTOH, they should be reused if some high load 
situation
occurs 
again (no new threads will be created). 
Unless you're really short on OS resources, I don't see that being a
huge 
problem. 

Remy  (12/2001... about TC4.0.1)


Do you keep thinking the same? It seems to be a serious problem from my
point of view!! Burst of requests increase the number of threads used by
Tomcat (I work nowadays with TC4.1.12), but I think they should be
released later on. Must they grow until infinite? Must I set
maxProcessors to 1 for avoiding Max number of processes
reached??? :-P A very complex system relies on Tomcat and a lot of
servlets, so I need a solution.

Some mails, like mine, proposed to dive in the code to change the
management of idle threads and kill them. If there isn't any scheduled
action about this problem, could anybody give me a hint about where to
look in the code?

Thanks in advance and best regards,

Carlos.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: decrease idle threads in the pool faster... (II)

2003-06-30 Thread Bill Barker

- Original Message -
From: Carlos Rodríguez Colino [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, June 30, 2003 1:21 AM
Subject: decrease idle threads in the pool faster... (II)



 Hi everybody

 I have been searching previous mails about killing idle threads, and I
 found lots of them describing the same problem (lots of requests carry
 out new threads that never are released, so, in a long-term, max number
 of proccesses is reached and Tomcat stops). Some surprising answers were
 such as:

 Yes, no attempt is being made at killing processing threads that
 were created. OTOH, they should be reused if some high load situation
 occurs
 again (no new threads will be created).
 Unless you're really short on OS resources, I don't see that being a
 huge
 problem.

 Remy  (12/2001... about TC4.0.1)


 Do you keep thinking the same? It seems to be a serious problem from my
 point of view!! Burst of requests increase the number of threads used by
 Tomcat (I work nowadays with TC4.1.12), but I think they should be
 released later on. Must they grow until infinite? Must I set
 maxProcessors to 1 for avoiding Max number of processes
 reached??? :-P A very complex system relies on Tomcat and a lot of
 servlets, so I need a solution.

 Some mails, like mine, proposed to dive in the code to change the
 management of idle threads and kill them. If there isn't any scheduled
 action about this problem, could anybody give me a hint about where to
 look in the code?


Well, the place to look is
j-t-c/util/java/org/apache/tomcat/net/PoolTcpEndpoint.java.  With my
experience, it works very well with the stand-alone connector.  On one very
old (and brain-dead) Linux system, I had to set a soTimeOut for the
Jk-Connector to get it to kill-off Threads (but this is really a work-around
to a problem with that Linux version).


 Thanks in advance and best regards,

 Carlos.

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



decrease idle threads in the pool faster...

2003-06-26 Thread Carlos Rodríguez Colino

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]