Question

Does setting a high session timeout use more server resources? Or is this just the amount of time until a session cookie on the users local machine expires?

Était-ce utile?

La solution

Good Question..

  • Configuring large session timeout value results in HttpSession objects occupying memory longer than necessary

  • The Servlet container keeps track of all HttpSession objects and determines whether a user is active or not by comparing the time of the user's last access of the application with the session timeout value.

  • take one example, if average memory taken by a session is 10KB, here is case of 1lakhs and 2lakhs user with 30 minutes timeout

enter image description here

and now if increase timeout to 60 minutes,

enter image description here

You can see the difference in memory application occupy double memory to hold session.

Conclusion : Do not increase the session timeout value unless it is absolutely necessary. It is best if you can leave the default session timeout value at 30 minutes, or even set it lower if your application permits.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top