[Prev][Next][Index][Thread]

Re: Multi-threading vs. Multi-processing?



At 16:12 Uhr -0500 15.02.1997, CHRISTOPHER ELIOT wrote:
>I've considered implementing a "poor man's" version of multi-processing by
>putting my graphics onto separate machines with only the computed URLs
>handling by a central server. Would this be useful? 

Sure. This is common practice.
Another possibility would be to have a router which
serves to the outside one IP-Number and in the inside
multiple machines will get the tasks in a random fashion.
Or a DNS server that returns different IP-Numbers for
a name.


>I'm not sure exactly how best to implement this. I would like some way to
>specify a URL so that I could alter the target server easily. If I write
>#u"page43.html" this maps to the current machine. I would like to write
>#u"/graphics/page43.gif" and #u"/ai-stuff/page43.gif" and have the real
>URLs map onto separate machines, for example
>"http://my-sgi/graphics/page43.gif" and
>"http://my-ppc/ai-stuff/page43.html"
>
>Then I could put the graphics onto the SGI I wish I had, separating
>the load from my "intelligent" computations.

Why not something like:


(defparameter *number-crunchers*
  #("http://nc0.foo.com" "http://nc1.foo.com" "http://nc2.foo.com"))

(defun create-link (url-fragment hosts stream)
  (html2:image (http:merge-url url-fragment
                               (aref hosts (random (length hosts))))
               "image"
               :stream stream))

(loop repeat 5
      do (terpri)
      do (create-link "/gen/image.gif" *number-crunchers* t))

->
<IMG SRC="http://nc1.foo.com/gen/image.gif" ALIGN="TOP" ALT="image">
<IMG SRC="http://nc2.foo.com/gen/image.gif" ALIGN="TOP" ALT="image">
<IMG SRC="http://nc2.foo.com/gen/image.gif" ALIGN="TOP" ALT="image">
<IMG SRC="http://nc0.foo.com/gen/image.gif" ALIGN="TOP" ALT="image">
<IMG SRC="http://nc0.foo.com/gen/image.gif" ALIGN="TOP" ALT="image">


Put the link on the fly on the page.

An advanced task would be to attach such a mechanism
to a URL subclass.

Another (maybe not so good) possibility would be to
generate redirects.

Rainer Joswig

Rainer Joswig, Lavielle EDV Systemberatung GmbH & Co, Lotharstrasse 2b, D22041
Hamburg, Tel: +49 40 658088, Fax: +49 40 65808-202,
Email: joswig@lavielle.com , WWW: http://www.lavielle.com/~joswig/




Follow-Ups: References: