[plt-scheme] Continuations

From: Noel Welsh (noelwelsh at yahoo.com)
Date: Fri Nov 17 17:32:26 EST 2006

--- Akhilesh Mritunjai <mritun.lists at gmail.com> wrote:

> The issues related to continuations are among other
> things -
> persistence, load balancing and fail-over (ignoring the
> most powerful
> one - easy development).

At Untyped we've been developing commercial web based apps
for about 6 months now.  The load so far hasn't required we
use any kind of clustering.  However, we've been thinking
about about it and here's our current story for

 - Most of our sites are stateless, so don't use
continuations for these parts.  We dispatch on URL.

 - Of the remaining stateful parts, it makes sense to store
a good deal of it in cookies (e.g. login -- should be
shared by all open browser windows).  We have a request
handling pipeline that takes care of this.

 - We use continuations for the remaining (few) stateful
interactions.  If we were to use two or more servers this
is  the part we'd have to be careful load balancing.  The
way to do it is to add something to the URL that identifies
the particular machine that holds the continuation and have
the load balancer dispatch on the key.  This can be done
with existing technology.

In this design there is some vulnerability.  If a server
dies we'll lose all the continuation calls that it handles.
  It probably won't be a big issue (continuation calls are
maybe 10% of all interactions) but it's there.

Persistence is the other point you raise.  We've working on
a library for this (using relational DB backends).  SVN
access is public:


We're unhappy with a few things with the library, but it is
good enough for many uses.


Email: noelwelsh <at> yahoo <dot> com   noel <at> untyped <dot> com
AIM: noelhwelsh
Blogs: http://monospaced.blogspot.com/  http://www.untyped.com/untyping/

Sponsored Link

Mortgage rates near 39yr lows. 
$420k for $1,399/mo. Calculate new payment! 

Posted on the users mailing list.