[squeak-dev] Re: [OT] Perl or Python to start an image?

Colin Putney colin at wiresong.com
Thu Jan 24 02:07:03 UTC 2013


On Wed, Jan 23, 2013 at 4:10 PM, Craig Latta <craig at netjam.org> wrote:

>
> Hi Chris--
>
>      Off your off-topic topic, but... did you consider using FastCGI (or
> whatever) to hand off the request to an already-running Smalltalk, and
> use Smalltalk to start the requested image, instead of either Perl or
> Python?


If I understand correctly, Chris wants to use mod_rewrite's <RewriteMap>
with the 'prg' option[1]. That runs the specified binary/script and
communicates with it over stdin/stdout. There's no way to get it to use the
FastCGI protocol[2].

However, mod_rewrite doesn't run the rewrite program for each request like
a CGI. It invokes it once, and sends it urls on stdin as requests come in.
So it might be possible prepare an image that starts a rewrite server on
startup. The tricky bit is synchronization[3].

For DabbleDB we wrote a ruby program to do this—each server had a few
thousand images, each configured to run Seaside on a particular port. When
a request came in for that image, the ruby program would look up the port,
see if the image was running, and if not, start it, then rewrite the
request URL so that it would get proxied through to the image. The images
would automatically shut down if they didn't receive any requests for a
while.

[1] See https://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritemap
[2] Short of writing an Apache module to do it
[3] Note the "But be very careful:" section at the bottom of [1]

Colin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20130123/766b187e/attachment.htm


More information about the Squeak-dev mailing list