Tripp Lilley wrote:
> 
> I think this is definitely a case where the instance pooling
> algorithm is getting in the way of the threading vs. non-threading
> philosophy discussion. What I mean is, the fact that the pool is
> currently a static number of instances -should- be regarded as an
> implementation detail subject to change, and that change should be to
> introduce a dynamic pooling algorithm. This is true of DBPool and,
> well, every pooling mechanism :) 
> 
> So, in case it wasn't clear, the pool should increase its size to
> accomodate instantaneous demand and then trim itself back down to a
> reasonable size when the demand subsides.
> 
> It's actually easier to implement this than it sounds... When a
> request comes in for a pool object, the pool looks for an existing
> instance. If there are no existing instances, it doesn't
> -immediately- create one. Rather, it waits a specified time for an
> existing instance to become available, and, if not, -then- creates a
> new one. This puts an upper bound on the time a client will have to
> wait for a handler. This timeout is pretty easy to implement using a
> lock.wait(timeout) call on a lock that represents instance
> availability in the pool's internal queue. 
> 
> Discarding extra pool instances is left as an exercise to the reader
> :) 

I'm not conviced that a dynamic algorithm is better than just using a fixed
pool (assuming we're talking about threads, or servlet instances).  Your box
has to have enough memory and horsepower to handle the worse case of a
maxed-out pool, right?  If that's the case, then why not just allocate the
maximum right up front (or let the pools grow as needed like the servlet
pools)?  Surely having some extra threads or extra instances lying around
doesn't noticeably hurt performance.  Also, having to allocate extra
instances or threads to handle a surge of activity is bound to be somewhat
costly just at the time when you need the CPU to actually _handle_ the
requests.

When I deploy WebKit I set the minimum, maximum, and initial thread pool
sizes to the same value.  Can someone convince me why this is a bad idea?

- Geoff


-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to