[Seaside] REST and Seaside

David T. Lewis lewis at mail.msen.com
Sat Apr 9 18:27:39 CEST 2005


On Fri, Apr 08, 2005 at 08:58:37AM -0700, Nevin Pratt wrote:
> As many of you know, I've been running Bountiful Baby on Seaside for 
> over a year now.  Well, the site has increased in popularity to the 
> point where the traffic appears to be a serious problem for Seaside.  I 
> have regularly been seeing memory footprints of the Seaside image up 
> around a gigabyte.  The latest image save was over half a gig.  And 
> occasionally I see image freezes over extended periods of time (half a 
> minute or so), and it is probably related to a huge image footprint.

Hi Nevin,

I would guess that those large image saves could make your server
appear to lock up for a half minute. If that is the case, and if you
have lots of physical memory on your server, you can probably hide
this from your users by doing something like this for the image saves:

   UnixProcess forkHeadlessSqueakAndDo: [
      | newName timeStamp st |
      timeStamp := (TimeStamp current printString first: 19) copyReplaceAll: ':' with: '-'.
      newName _ 'squeak-', timeStamp.
      st := SmalltalkImage current.
      (Delay forMilliseconds: 200) wait.
      (SourceFiles at: 2) ifNotNil:
         [st closeSourceFiles; "so copying the changes file will always work"
            saveChangesInFileNamed: (st fullNameForChangesNamed: newName)].
      st saveImageInFileNamed: (st fullNameForImageNamed: newName).
      st snapshot: false andQuit: true]

Your main Squeak server image will keep running without interruption while
another headless Squeak saves the image. Even though it runs another Squeak
image, it won't use much real memory (the two Squeaks share most of the same
memory space due to Unix memory management).

OSProcess is on SqueakMap. I'm assuming you are using a Unix/Linux server,
hopefully my recollection is correct.

Test this carefully, I just hacked it together in response to your post, and
it's not something I have a need to use myself. But it should help get rid
of the big delays your users are seeing.

HTH,
Dave



More information about the Seaside mailing list