load-balancingmod-clustersticky-session

Sticky session duration


is it possible to specify the sticky session duration in mod_cluster?

I mean that the stuck session is cleared when there isn't activity for a period of time.

We have a distributable application that keeps a reference to logged user in the web session. But at login time, the web session replication isn't enough fast as requests that follow the login request. So, if, for those requests, the balancer choose a node that doesn't have been replicated yet, the user wouldn't be in session and an error occur.

Another use of this functionality would be when you use cached information on a server. If you don't use sticky session you would load to cache several times the same information in different servers. But if you use sticky session you would be tied to the same server for all session life.

Thanks in advance

Leandro


Solution

  • Answer

    It is not possible to switch session stickiness in mod_cluster On and Off for a certain time duration. One either has it On or Off.

    Further comments

    IIUC, you are in fact after session expiration or session invalidation. You can programatically decide to invalidate your session at any moment, or you might let it expire by setting expiration timeout.

    Could you perhaps elaborate more on how would you use the "session stickiness timeout"? We could create a JIRA and and implement a new feature if it makes sense...