Stateful Lift + dynamic load balancing: how does Lift scale down?

62 views
Skip to first unread message

Byron Gibson

unread,
May 20, 2013, 4:54:40 PM5/20/13
to lif...@googlegroups.com
Hi all, when you run a stateful Lift app on, say, AWS using Elastic Load Balancer, and it spawns additional Lift instances in response to spikes, and then despawns them when the spike ends, what's SoP for handling the user state in the despawned instances?  

Do you just assume the users on those instances were part of a temporary spike and won't be back anyway, so don't need their state preserved?  Or something else?

I haven't had to cross this bridge yet, but it recently occurred to me I might, and I don't see anything in the Cookbook or Assembla wiki specifically addressing this.

Thanks!

Byron Gibson

unread,
May 20, 2013, 5:02:06 PM5/20/13
to lif...@googlegroups.com
Edit:  Oh, found it in a blog post referenced from the ELB docs:


"When scaling up (adding more application servers) ELB maintains stickiness of existing sessions. Only new connections will be forwarded to the newly-added application servers.

When scaling down (removing application servers), you should expect some of your clients to lose their sessions and require logins again. This is because some of the stored sessions were on the application server that is no longer servicing requests."

So unless there's a trick with Lift I don't know about, if you're using stateful Lift then you'll lose the state of the new connections made during the spike.  I can live with that.

David Pollak

unread,
May 20, 2013, 5:08:23 PM5/20/13
to liftweb
If you use ProtoExtendedSession, your users stay logged in. The current page they are viewing will be refreshed when the session is lost.


--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
 
---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Telegram, Simply Beautiful CMS https://telegr.am
Lift, the simply functional web framework http://liftweb.net

Reply all
Reply to author
Forward
0 new messages