Threads always sitting at MinServerThreads

Oliver Bock <[email protected]> Thu, 02 Dec 2010 14:14:05 +1100
Newsgroups gmane.comp.python.webware
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============8743375484790026512==
Content-Type: multipart/alternative;
	boundary="------------020407010605040005000500"

This is a multi-part message in MIME format.
--------------020407010605040005000500
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

I recently installed Webware 1.1b on a new machine, and left it at its 
default Min/Start/MaxServerThreads (5/10/20) in 
webwarework/Configs/AppServer.config.  I have observed that even when 
MinServerThreads are all busy, Webware is not starting new threads to 
handle new connections.  Looking at the code, this seems to be because 
Webware decides how many threads it needs based on past activity; all 
threads being busy does not in itself trigger the creation of new 
threads.  (I could be misunderstanding the code here.)

I observed it using a simple Webware script that reports the number of 
active threads and roughly what they are doing.  This script is normally 
very fast because it waits on no locks and does no database work.  
However when the server is busy I have occasionally noticed a several 
second delay before it returns, and when it does return I see that the 
other threads are all busy, and that the number of threads is still just 
5.  In fact, the number of threads is /always/ just 5, so far as I can see.

Perhaps it is just that my requests come in a bad pattern: I observe 
that most of the Webware threads are idle most of the time, but 
occasionally a bunch of requests will come in together, and slow each 
other down trying to update the same table.  As they wait, others pile 
in until the database clears the backlog and everyone is finished.

I have fixed my problem by upping MinServerThreads to 20.  I also 
noticed that I had MinServerThreads set to 100 on my old machine 
(Webware 0.8.1 or thereabouts), courtesy of an incident a few years ago 
when some of my threads were locking up, so I suspect what I am 
observing is not new.

So my question is: is this behaviour normal?  Am I handling this the 
right way?


   Oliver

--------------020407010605040005000500
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    I recently installed Webware 1.1b on a new machine, and left it at
    its default Min/Start/MaxServerThreads (5/10/20) in
    webwarework/Configs/AppServer.config.&nbsp; I have observed that even
    when MinServerThreads are all busy, Webware is not starting new
    threads to handle new connections.&nbsp; Looking at the code, this seems
    to be because Webware decides how many threads it needs based on
    past activity; all threads being busy does not in itself trigger the
    creation of new threads.&nbsp; (I could be misunderstanding the code
    here.)<br>
    <br>
    I observed it using a simple Webware script that reports the number
    of active threads and roughly what they are doing.&nbsp; This script is
    normally very fast because it waits on no locks and does no database
    work.&nbsp; However when the server is busy I have occasionally noticed a
    several second delay before it returns, and when it does return I
    see that the other threads are all busy, and that the number of
    threads is still just 5.&nbsp; In fact, the number of threads is <i>always</i>
    just 5, so far as I can see.<br>
    <br>
    Perhaps it is just that my requests come in a bad pattern: I observe
    that most of the Webware threads are idle most of the time, but
    occasionally a bunch of requests will come in together, and slow
    each other down trying to update the same table.&nbsp; As they wait,
    others pile in until the database clears the backlog and everyone is
    finished.<br>
    <br>
    I have fixed my problem by upping MinServerThreads to 20.&nbsp; I also
    noticed that I had MinServerThreads set to 100 on my old machine
    (Webware 0.8.1 or thereabouts), courtesy of an incident a few years
    ago when some of my threads were locking up, so I suspect what I am
    observing is not new.<br>
    <br>
    So my question is: is this behaviour normal?&nbsp; Am I handling this the
    right way?<br>
    <br>
    <br>
    &nbsp; Oliver<br>
  </body>
</html>

--------------020407010605040005000500--


--===============8743375484790026512==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
--===============8743375484790026512==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Webware-discuss mailing list
Webware-discuss-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/webware-discuss

--===============8743375484790026512==--