Client Variables and Load Balancing

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

Hi Ken,

There are 2 things you would want to consider:

  1. Use “this.sessionCluster = true” and “this.clientCluster = true” in Application.cfc. See Application.cfc / <cfapplication> :: Lucee Documentation http://docs.lucee.org/reference/tags/application.html
  2. Be careful with : 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 KlinkenbergOp 7 aug. 2015, om 01:17 heeft Ken John <@Ken_John> het volgende geschreven:

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


See Lucee at CFCamp Oct 22 & 23 2015 @ Munich Airport, Germany - Get your ticket NOW - http://www.cfcamp.org/ 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+unsubscribe@googlegroups.com mailto:lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com mailto:lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/8cb226c5-3135-40fb-bf35-612228742fc5%40googlegroups.com https://groups.google.com/d/msgid/lucee/8cb226c5-3135-40fb-bf35-612228742fc5%40googlegroups.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout https://groups.google.com/d/optout.

No there Is no setting yet, but it would make sense.
Cab you raise a feature request ticket for it?

MichaAm Freitag, 7. August 2015 schrieb Ken John :

Paul,

Thank you very much that worked.

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

On Thursday, August 6, 2015 at 7:41:05 PM UTC-5, Paul Klinkenberg wrote:

Hi Ken,

There are 2 things you would want to consider:

  1. Use “this.sessionCluster = true” and “this.clientCluster = true” in
    Application.cfc. See
    Application.cfc / <cfapplication> :: Lucee Documentation
  2. Be careful with : 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

Op 7 aug. 2015, om 01:17 heeft Ken John ken....@vansontech.com het
volgende geschreven:

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


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
https://groups.google.com/d/msgid/lucee/8cb226c5-3135-40fb-bf35-612228742fc5%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.


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+unsubscribe@googlegroups.com
<javascript:_e(%7B%7D,‘cvml’,‘lucee%2Bunsubscribe@googlegroups.com’);>.
To post to this group, send email to lucee@googlegroups.com
<javascript:_e(%7B%7D,‘cvml’,‘lucee@googlegroups.com’);>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/ca2ce82e-f881-42b3-acd9-aedbbb02e78f%40googlegroups.com
https://groups.google.com/d/msgid/lucee/ca2ce82e-f881-42b3-acd9-aedbbb02e78f%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.