4
votes

Starting the tomcat service is fast, but first call to my app takes up to 5 minutes to response (for that very first time). This is tomcat 8 but in previous version of tomcat, same app, it just take a few seconds to start responding.

This is the log record in tomcat8-stderr.2014-09-03.log

03-Sep-2014 11:28:44.821 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.0\webapps\MYAPP has finished in 318,235 ms

Any help about debugging this behavior would be appreciatte.

1

1 Answers

2
votes

First you should really try to see what is taking the long time. One way to do it would be to take several thread dumps during the startup and try and see if any method is responsible for the long time.

One possibility is that the cause is annotation scanning from the web socket api (introduced in version 7.0.47), so you could try is to exclude some jar from scanning. In tomcat8, it is done by a system property or use a <JarSanFilter> in your context.

See the wiki for more details.