On Fri, 2002-08-09 at 17:53, Tavis Rudd wrote:
> Hi,
> I was looking over the recent changes in Application.py that switched from
> using a Queue to a list for the servlet instance cache and noticed something
> odd. There doesn't seem to be any limit on the size of the cache.
>
> Line 105 reads
> self._instanceCacheSize = self._server.setting('MaxServerThreads')
> but self._instanceCacheSize isn't used anywhere.
>
> 'createServletInTransaction(self, transaction)' creates a new servlet instance
> on line 990 if the cache is empty at the time of the request, but it doesn't
> check to see how many instances have already been created. Likewise,
> 'returnInstance(self, transaction, path)' returns instances to the cache on
> line 931 without checking to see how many instances are already in the cache.
>
> Shouldn't _instanceCacheSize be used? It seems possible with the current code
> for the number of instances to get out of control if there was a flood of
> simultaneous requests.
>
> Tavis
>
> See
>
>http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/webware/Webware/WebKit/Application.py.diff?r1=1.137&r2=1.138
> and
>
>http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/webware/Webware/WebKit/Application.py?rev=1.138&content-type=text/vnd.viewcvs-markup
>
It's impossible for an instance cache to grow larger than the maximum
number of threads simply because of the logic of how requests are
processed. Therefore there's no need to use self._instanceCacheSize
(which I should have removed).
At least, that's the theory. It's probably worth running a test with an
artifically low number of maximum threads (like 2) and then hammer the
server with tons of simultaneous requests. I'm pretty confident that
the instance caches would never grow above 2 items. You can view the
size of the caches in the Admin pages.
- Geoff
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss