Thanks, my co-worker has actually already implemented your session
killing logic, and in our load tests it increases scalability a LOT
(when there are lots of requests each creating their own session). One
problem we hit was that the code calls rt.gc, forcing a garbage
collect, which we didn't notice, this happens every 10s (?) and caused
big delays (probably due to our large heaps) on our servers, took us a
couple days to notice and fix that.
I think there would still be value in marking requests stateless for
google, and either never keeping the session in the first place or
purging it immediately.
Your suggestion of including the request in the stateless test sounds
good. Would (or did) you consider not throwing exceptions when
something attempts to store state? The last thing I'd want is to
accidentally throw exceptions as google crawls the site. I see the
value in being strict, perhaps there are three modes: Stateless,
TransientStateful, and Stateful. In TransientStateful you allow state
to be set, but you discard it.
On Aug 19, 11:58 am, David Pollak <
feeder.of.the.be...@gmail.com>
wrote:
> Alex,
>
> The way I address this issue onhttp://demo.liftweb.netis to expire
> sessions that meet a particular criteria. See:
https://github.com/lift/examples/blob/master/combo/example/src/main/s...
> and SessionInfoDumper in:
https://github.com/lift/examples/blob/master/combo/example/src/main/s...
>
> It's possible to every 20 seconds to delete all sessions created by the
> Google user agent.
>
> The Foursquare guys do some custom Stateless testing... I don't know how.
>
> More broadly, the current Stateless testing could be enhanced in the
> following ways:
>
> - Having a stateless test that include the HTTPRequest so that the user
> agent can be extracted
> - Having a Loc-based Stateless test that allows for per-request
> statelessness testing
> - Having a trait that can be mixed into snippets that will provide
> behavior if the snippet is invoked from a stateless session (this will allow
> automagic separation of snippets on pages that can be either stateful or
> stateless)
> - Having a default behavior for CometActors invoked from a stateless page
>
> If you or others have thoughts on the above, please chime in. If you'd be
> so kind as to open a ticket for the above issues and reference this thread,
> I'd appreciate it.
>
> Thanks,
>
> David
>
>
>
>
>
>
>
>
>
> On Fri, Aug 19, 2011 at 8:24 AM, Alex Black <
a...@alexblack.ca> wrote:
> > Google crawls our sites, a LOT :) I'm pretty sure a new session gets
> > generated for every request from google (or any bot/search engine).
>
> > Is there any way to mark requests as stateless by user agent or some
> > other arbitrary logic? Or could the existing statelessRequest rules be
> > extended to support something like this?
>
> > - Alex
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to
lif...@googlegroups.com.
> > To unsubscribe from this group, send email to
> >
liftweb+u...@googlegroups.com.
> > For more options, visit this group at
> >
http://groups.google.com/group/liftweb?hl=en.
>
> --
> Lift, the simply functional web frameworkhttp://
liftweb.net
> Simply Lifthttp://
simply.liftweb.net