Client Variables and Load Balancing

182 views
Skip to first unread message

Ken John

unread,
Aug 6, 2015, 7:17:00 PM8/6/15
to Lucee
Hello,

We are setting up a new production environment using Lucee. We are running 2 instances behind a load balancer in a round robin configuration. 


First thing we are noticing is that when logging into our app on 1 instance and redirecting during the sign in process if we land on the 2nd instance the client variables are not populated. We store the client variable in a database. 

In our testing we noticed that deleting the client variables from the database and refreshing the page actual re-created all the variables with out going through the sign in process again. So our theory is that client variables are cached in Lucee's Memory and then stored in the database after some time. We also tested deleting all variables from the database and restarting the instance to verify that client variables are store in memory and that Lucee does not verify that they are in the database.

My Question is:
Does Lucee cache client variable in memory and them dump to the database?

If there is a delay in the save to the database how would you persist client data to multiple instances on a larger scale?

-Ken

Paul Klinkenberg

unread,
Aug 6, 2015, 8:41:05 PM8/6/15
to lu...@googlegroups.com
Hi Ken,

There are 2 things you would want to consider:
1) Use "this.sessionCluster = true" and "this.clientCluster = true" in Application.cfc. See http://docs.lucee.org/reference/tags/application.html
2) Be careful with <cflocation>: it happened to me a lot that the session info was not written to the database yet, when the Location-change occured. This sucked when doing a login routine with sessions vars, with a follow-up cflocation.

> Does Lucee cache client variable in memory and them dump to the database?
By default, yes. Option 1) above will fix that.

Kind regards,

Paul Klinkenberg


--
See Lucee at CFCamp Oct 22 & 23 2015 @ Munich Airport, Germany - Get your ticket NOW - http://www.cfcamp.org/
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/8cb226c5-3135-40fb-bf35-612228742fc5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ken John

unread,
Aug 7, 2015, 3:37:22 PM8/7/15
to Lucee
Paul,

Thank you very much that worked. 

Is that something that can be turned on at the server level for all application?

Paul Klinkenberg

unread,
Aug 7, 2015, 5:09:59 PM8/7/15
to lu...@googlegroups.com
Hi Ken,

Glad to hear it resolved your issue. When I encountered the same problem a year ago, it took me hours to find out ;)

I don't think it's possible to make this a default setting for all applications currently. There does seem to be a ticket for it: https://luceeserver.atlassian.net/browse/LDEV-210

Kind regards,

Paul


Michael Offner

unread,
Aug 10, 2015, 3:45:33 PM8/10/15
to lu...@googlegroups.com
No there Is no setting yet, but it would make sense. 
Cab you raise a feature request ticket for it?

Micha
Reply all
Reply to author
Forward
0 new messages