1

I've this old spring MVC project with Jsps, packaged as war and deployed in jboss server. Moved it to spring boot with embedded tomcat. Everything works fine. But if I package it into executable war and run it as standalone , I see some performance lag of about 2000 ms. Weird thing it happens for every first request I send after some time (say request sent after 2 mins gap) The consecutive requests go through fine.

I also observed CPU usage going high during that time consuming request, which doesn't happen when I don't pack it as war.

I'm struck up on this for a couple of days and nearing the dead line. Any suggestions or leads will be welcome.

p.s request in the sense a web request where jsp is returned at the end.

Josh
  • 73
  • 1
  • 9
  • 1
    Does this also happen on the first request? Might this be an issue youre facing with som sorts of caching not being properly defined? I.e the page is being generated each time/not precompiled? – vegaasen Apr 12 '18 at 05:35
  • Can you try compiling JSPs in the war ? https://stackoverflow.com/questions/23211906/compile-jsp-using-maven – Lyju I Edwinson Apr 12 '18 at 06:14
  • I have already tried pre compiling, does not work. I ran jprofiler , and saw that cpu is taking time (the lagging 2000 ms) in logging. Then tried after removing logging, Now it shows cpu is taking time to load jsp which is inside the war (the same time) Actually there are 2 api calls internally to other servers, when I make a single request. The lag is only on the first api call, the 2nd api call is fine – Josh Apr 12 '18 at 06:52
  • And there is no performance lag when I run in exploded form, does it have something to do with war packaging? – Josh Apr 12 '18 at 06:54
  • Deployed as war on a Tomcat 8 server, instead of the embedded server. And it works fine. Not sure why – Josh Apr 14 '18 at 16:04

0 Answers0