[plt-scheme] Web server consuming much memory and slowing down with use -- some benchmarks.

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Wed Apr 25 07:05:05 EDT 2007

On 4/25/07, Ethan Herdrick <info at reatlas.com> wrote:
> Hi folks:
>
> On my windows machine, with version 360, the web server eats a ton of
> memory and steadily slows down when repeatedly running a servlet of
> any kind, or even serving static files.  For example, when I use this
> very simple servlet:
>
> (module max-static mzscheme
>
>   (require (lib "servlet.ss" "web-server"))
>   (require (lib "response.ss" "web-server"))
>   (provide interface-version timeout start)
>
>   (define interface-version 'v1)
>
>   (define timeout +inf.0)

Because of this line, the web-server will never reclaim memory used by
this servlet. Every request will create a structure used to hold
continuations that it might capture (the server doesn't know it
doesn't actually use them) and then hold on to that structure forever.

Serving static files could depend on what your other timeout settings
are. Because of HTTP/1.1 it doesn't hang up connections until your web
browser does, but some browser/benchmarks expect the server to hang
up.

Jay

-- 
Jay McCarthy <jay.mccarthy at gmail.com>
http://jay.teammccarthy.org


Posted on the users mailing list.