[Seaside] Getting scriptaculous to work

Lukas Renggli renggli at gmail.com
Thu Aug 24 07:58:24 UTC 2006


> Lukas may have written somewhere about seasidehosting.st...

We got some of the ideas from Avi, but we have a slightly different
setup: since we don't have control about the images we cannot execute
code in-there and we cannot quit the image itself. We are using
mod_rewrite (those that read this list frequently know that I like and
use mod_rewrite a lot) to do the virtual hosting and dispatching to
the right image. It works like this:

1. Whenever a request is coming in mod_rewrite remembers the current
time-stamp for the image accessed.

2. Next mod_rewrite resumes the vm process of the image in question.

3. Then it forwards the request to the port the image is listening on.

4. A background job checks every few minutes if there are images
running that haven't received requests lately and suspends then.

Currently there are about 200 Squeak VMs running concurrently, most of
them asleep as they are not receiving any requests all the time.
Suspending the VM avoids to have garbage-collection going on all the
time and allows the operating system to swap them out.

To give you an idea about the load I copied the top of the output of top:

top - 09:59:55 up 210 days, 21:44,  1 user,  load average: 1.34, 1.27, 0.87
Tasks: 431 total,   2 running, 266 sleeping, 162 stopped,   0 zombie
Cpu(s):  1.0% us,  4.4% sy, 25.8% ni, 68.7% id,  0.2% wa,  0.0% hi,  0.0% si
Mem:   4025952k total,  4012388k used,    13564k free,   130336k buffers
Swap:  2650684k total,        0k used,  2650684k free,  1322552k cached

So our solution is mod_rewrite only, no ruby ;-)

Cheers,
Lukas

-- 
Lukas Renggli
http://www.lukas-renggli.ch


More information about the Seaside mailing list