[Seaside] REST and Seaside

David Shaffer cdshaffer at acm.org
Sat Apr 9 22:09:33 CEST 2005


Nevin Pratt wrote:

> [snip]
>
> And, as I mentioned in a response to Avi, it is Squeak 3.5, Seaside
> 2.3, and Comanche 5.x.
>
Nevin,

Are you using the "unregistered" session method?  I can't remember if it
was present in 2.3.  Anyway there was a bug in the 2.5b series (which
was recently corrected) which, under some circumstances, caused sessions
to not receive the #unregistered notification.  This happened when
several sessions were unregistered at once.  I noticed it on one of my
servers and it caused stress on the garbage collector...potentially
delaying the clean up of database resources, for example, until GC
occurs.  The bug is easy to identify so if you think it might be
impacting you, let me know off list and I'll send you a correction for
the affected method (again, 2.5...don't know the situation in 2.3).

In Seaside 2.5 session expiration is checked only when new sessions are
created.  I've been experimenting with other schemes but I haven't
gotten far since my instrumentation causes signficant performance
problems.  One scheme that I do use in production is to keep a service
running which checks for dead sessions at fixed intervals.  Since
session clean up and subsequent GC can be expensive it is nice to have
as much done during idle times as possible.  This background process
seems to make my server more responsive to the first page accesses in a
session.  It also reduced the impact of expensive GC's I was seeing
after periods of high activity.  I have attached the version from my
development image.  I believe it is unchanged from my current production
version and has worked for me for some time now.  Start it using:

service := SessionExpirationService newNamed: 'session reaper'.
service start

This version checks every 30 seconds.  You'll have to edit the code to
change the interval.

David


-------------- next part --------------
'From Squeak3.7 of ''4 September 2004'' [latest update: #5989] on 9 April 2005 at 4:04:12 pm'!
ApplicationService subclass: #SessionExpirationService
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'SC-SeasideHacks'!

!SessionExpirationService methodsFor: 'private' stamp: 'cds 4/9/2005 16:04'!
informApplications
	WADispatcher default entryPoints do: [:app |
		app unregisterExpiredHandlers]! !


!SessionExpirationService methodsFor: 'running' stamp: 'cds 3/13/2005 19:04'!
runWhile: aBlock
	[aBlock value] 
		whileTrue: [self sleepFor: 30000.
		self informApplications]
! !


More information about the Seaside mailing list