After a long period of inactivity say around 5 hours, application takes more time to load landing page after login. After the first time login, next succcessive logins will work fine without any issues. This issue is happening in tomcat 8 application server. Do we have any workaround or configurations in tomcat such that this delay can be mitigated. Please suggest.
Asked
Active
Viewed 117 times
0
-
1Could be a million things. Expired database caches, expired resource caches, JSP pages being recompiled, and so on. – Robby Cornelissen Jan 11 '18 at 10:35
-
One possible explanation is that after a long period of inactivity, Tomcat starts unload unsed classes from classloader. Then when Tomcat needs these classes again, it needs to recompile these classes to put it in the classloader. And this takes time. – Mickael Jan 11 '18 at 10:35
-
@Mickael, dont we have control over this. I mean can't we stop unloading of unused classes from classloader.? – yogish Jan 11 '18 at 10:38
-
Here in my case, tomcat server will be up and running, and i am not stopping the tomcat server at all. But after a certain period of inactivity (around 5 hours), first time login is taking more time. Landing page after login is taking more time. – yogish Jan 11 '18 at 10:41
-
As Robby said, there're a lot of possible explanation to your problem. You should start to analyze where's the problem is actually coming from. Classloader is one of the most common explanation to this. If you want more information about classloader, I suggest you read this : https://stackoverflow.com/questions/148681/unloading-classes-in-java – Mickael Jan 11 '18 at 10:51
-
Maybe it's just as simple as a harddisk waking up after the spin-down time. (Made this a comment as suggested by @MickaëlB) – SurfMan Jan 11 '18 at 11:02