Tomcat sessions expiring unexpectedly

前端 未结 9 1780
无人及你
无人及你 2020-12-30 04:57

We are running tomcat application server that handle over 100 concurrent sessions. In the last 2 months the most active users noticed that sometimes they are getting kicked

相关标签:
9条回答
  • 2020-12-30 05:31

    Eventhough I do not know the cause of the problem, one possible fix (which I had done at my previous project) would be to run the application on a tomcat cluster and have session failover. Sessions can be by default sticky and when one node goes down, the healthy nodes pick up the sessions and all this is transparent to the end user.

    0 讨论(0)
  • 2020-12-30 05:35

    there is a timeout, that you can configure in your web.xml:

    <web-app>
      ...
      <session-config>
        <session-timeout>-1</session-timeout> 
      </session-config>
    </web-app>
    

    use -1 for no timeout

    0 讨论(0)
  • 2020-12-30 05:37

    You can search Tomcat's bug database, but it would be better to have another look at your web application first. The chances that there is something wrong with Tomcat are very low.

    Try to investigate what causes session invalidation. Are you using filters? Do you have cross-context requests? Try adding logging information for every request to find out, when exactly the session is lost.

    0 讨论(0)
提交回复
热议问题