[plt-scheme] Servlet Timeouts

From: Arend P. van der Veen (apvanderveen at att.net)
Date: Fri Jul 2 11:38:17 EDT 2004


If I understand correctly, you are saying that some of the memory PLT 
Scheme requests from the operating system is not freed.    So am I 
correct in concluding that if I run a production web server for a long 
period of time it will eventually run out of memory ?  If this is the 
case are there any work arounds ?

Thanks in advance,
Arend van der Veen

Greg Pettyjohn wrote:

>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> There is a servlet timeout test as part of the servlet test suite.
> I will be improving these tests in the next week or so.
> Pete Hopkins, a student at Brown, has also done a series of stress 
> tests which characterize the server's
> resource usage with respect to continuations.
> We have identified a few problems with managing the lifetimes of 
> continuations and
> will be providing a solution in  some future version of the server.
> Although this is a research project that we are currently aggressively 
> pursuing, we
> are still only a few weeks into it and I don't yet have a prediction 
> as to when a solution will
> be available.
> On Jul 1, 2004, at 8:16 AM, Arend P. van der Veen wrote:
>>  For list-related administrative tasks:
>>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>> Hi,
>> I have been attempting to test the servlet timeout feature to confirm 
>> that the system reclaims continuations used by a servlet.  To perform 
>> this test I wrote a function (in Python) on another machine that 
>> accessed the add.ss example servlet.  The function submits the first 
>> number but never submits the second number.  I call this function 
>> 40,000 times.  According to my web server configuration file I would 
>> expect that the servlet should time out in two minutes (default 
>> servlet timeout = 120 seconds).   After I completed my test the web 
>> server process has consumed about 152 MB of RAM.     I think that the 
>> memory consumption has stabilized even if I rerun the test (and not 
>> restart the web server).  Also, it takes much more then 2 minutes for 
>> my python client to access the server 40,000 times.
>> 1.   I was originally having problems with the add servlet leaking 
>> memory.  I included a send/finish at the end of the unit.  My new 
>> add.ss is at the end of this post.  Am I correct in assuming that 
>> this servlet should not leak memory now ?
>> 2.   Do the log files contain any information indicating that a 
>> servlet has timeout ?  I was not able to find any indications.
>> 3.   When the servlet times out should all the RAM associated with 
>> the servlet be automatically released ?
>> Thanks in advance for your help.
>> Arend van der Veen
>> add.ss:
>> (require (lib "unitsig.ss")
>>         (lib "servlet-sig.ss" "web-server")
>>         (lib "servlet-helpers.ss" "web-server")
>>         (lib "date.ss"))
>> (unit/sig () (import servlet^)
>>  ; request-number : str -> num
>>  (define (request-number which-number)
>>    (string->number
>>     (extract-binding/single
>>      'number
>>      (request-bindings (send/suspend (build-request-page 
>> which-number))))))
>>  ; build-request-page : str -> str -> response
>>  (define (build-request-page which-number)
>>    (lambda (k-url)
>>      `(html (head (title "Enter a Number to Add"))
>>             (body ([bgcolor "white"])
>>                   (form ([action ,k-url] [method "post"])
>>                         "Enter the " ,which-number " number to add: "
>>                         (input ([type "text"] [name "number"] [value 
>> ""]))
>>                         (input ([type "submit"] [name "enter"] [value 
>> "Enter"])))))))
>>  (define (answer-page)
>>    `(html (head (title "Sum"))
>>         (body ([bgcolor "white"])
>>               (p "The sum is "
>>              ,(number->string (+ (request-number "first") 
>> (request-number "second")))))))
>>  (send/finish (answer-page)))

Posted on the users mailing list.