Search code examples
liferayliferay-6

for autoextended liferay sessions: why is a smaller session.timout recommended?


In the user guide section on session.timeout.auto.extend, Liferay specifies:

It is recommended to use this setting along with a smaller session.timeout,
such as 5 minutes, for better performance.

What exactly does 'better performance' mean ?

I haven't changed my session timeout and some of my users are getting lost sessions. I assume changing this value might solve the issue, but I would really like to understand better.

Thanks, Alain


Solution

  • What exactly does 'better performance' mean ?

    Lets say you have 10 Users who are currently logged in. If session.timeout value specified is 5 minutes, then, if these 10 Users are idle for 5 minutes their session will get destroyed. Its a good practice (and everyone does) that you close any open connections (like DB), free the thread and perform other resource management actions so that other Users who are going to login can use them.

    But lets say the session.timeout value specified is 20 minutes. Then the resources allocated to these 10 Users will get freed only after they go idle for 20 minutes (unless they themselves logout). This example was explained only with 10 users. But, in real time, there would be thousands to lakh users who will be using your resources.

    In summary, better performance can be achieved by keeping a lower value for session.timeout because you will be freeing the allocated threads and other resources quickly.