Topic
  • 9 replies
  • Latest Post - ‏2012-09-26T13:19:31Z by Jacek_Laskowski
SudhirKoka
SudhirKoka
5 Posts

Pinned topic JSP pages load very slowly in Liberty profile

‏2012-09-20T18:50:55Z |
The JSP pages for our application takes a few minutes load in Liberty profile. These same JSP pages load very fast within a few seconds in embedded WAS server.

I have tried different jspEngine settings including
<jspEngine recompileJspOnRestart="true" useInMemory="true" disableJspRuntimeCompilation="false" />

But none of these worked.

Can someone help me with this issue and provide me some hints on how to improve the loading of JSP pages in Liberty Profile?
  • SudhirKoka
    SudhirKoka
    5 Posts

    Re: JSP pages load very slowly in Liberty profile

    ‏2012-09-21T23:02:12Z  
    On regular WAS server, the "-precompileJSPs" option in AdminApp.install method can be used to precompile any JSP files during install time.
    Here's an example:
    AdminApp.install(Source, )

    But it seems like the JSPs do not get pre-compiled during install or startup time in WAS Liberty profile. Is there an option to pre-compile JSPs during install or startup in WAS Liberty Profile? Please let me know.

    Thanks,
    Sudhir
  • Jacek_Laskowski
    Jacek_Laskowski
    133 Posts

    Re: JSP pages load very slowly in Liberty profile

    ‏2012-09-24T12:49:01Z  
    Hi,

    I don't know the answer for your question, but useInMemory is not supposed to work and is listed as a limitation in jsp-2.2 feature restrictions.

    Jacek
    Japila :: verba docent, exempla trahunt
  • R.Goff
    R.Goff
    6 Posts

    Re: JSP pages load very slowly in Liberty profile

    ‏2012-09-24T15:06:16Z  
    Hi,

    I don't know the answer for your question, but useInMemory is not supposed to work and is listed as a limitation in jsp-2.2 feature restrictions.

    Jacek
    Japila :: verba docent, exempla trahunt
    You should be able to use the <jspEngine prepareJSPs="0"/> attribute. You do not need to use any other jsp options with this. All the jsps should be translated/compiled after the first jsp is hit which should improve the performance for all other requests.
    Here is some information about this property:
    When this attribute is present, all JSPs are compiled when one jsp in an application is requested. The numeric attribute value represents the minimum size (in kilobytes) that a JSP must be in order to also be classloaded and JIT-compiled. The default is 0, which causes all JSPs to be classloaded and JIT-compiled.
  • SudhirKoka
    SudhirKoka
    5 Posts

    Re: JSP pages load very slowly in Liberty profile

    ‏2012-09-24T20:01:34Z  
    • R.Goff
    • ‏2012-09-24T15:06:16Z
    You should be able to use the <jspEngine prepareJSPs="0"/> attribute. You do not need to use any other jsp options with this. All the jsps should be translated/compiled after the first jsp is hit which should improve the performance for all other requests.
    Here is some information about this property:
    When this attribute is present, all JSPs are compiled when one jsp in an application is requested. The numeric attribute value represents the minimum size (in kilobytes) that a JSP must be in order to also be classloaded and JIT-compiled. The default is 0, which causes all JSPs to be classloaded and JIT-compiled.
    Hi,

    Using <jspEngine prepareJSPs="0"/> attribute has helped. The JSPs are getting compiled when the user first accesses the GUI. So, there is hardly any load time when the user accesses the GUI second time onwards.

    The problem now is that it takes about 3 and half minutes to get the JSPs compiled and GUI loaded for the first time. Is there an option to pre-compile these JSPs at the server startup time? That way, the user does not see the slow performance when he loads the GUI first time.

    Thanks,
    Sudhir
  • Jacek_Laskowski
    Jacek_Laskowski
    133 Posts

    Re: JSP pages load very slowly in Liberty profile

    ‏2012-09-25T09:29:24Z  
    • R.Goff
    • ‏2012-09-24T15:06:16Z
    You should be able to use the <jspEngine prepareJSPs="0"/> attribute. You do not need to use any other jsp options with this. All the jsps should be translated/compiled after the first jsp is hit which should improve the performance for all other requests.
    Here is some information about this property:
    When this attribute is present, all JSPs are compiled when one jsp in an application is requested. The numeric attribute value represents the minimum size (in kilobytes) that a JSP must be in order to also be classloaded and JIT-compiled. The default is 0, which causes all JSPs to be classloaded and JIT-compiled.
    Hi,

    Where did you find the attribute?! I can't seem to find it in Liberty profile Configuration elements in the server.xml file.

    Does this mean that I could use the full WAS's JspBatchCompiler? What about the other attributes as described in Pre-touch tool for compiling and loading JSP files?

    I love learning tools through their undocumented features! :)

    Jacek
    Japila :: verba docent, exempla trahunt
  • R.Goff
    R.Goff
    6 Posts

    Re: JSP pages load very slowly in Liberty profile

    ‏2012-09-25T13:44:12Z  
    Hi,

    Using <jspEngine prepareJSPs="0"/> attribute has helped. The JSPs are getting compiled when the user first accesses the GUI. So, there is hardly any load time when the user accesses the GUI second time onwards.

    The problem now is that it takes about 3 and half minutes to get the JSPs compiled and GUI loaded for the first time. Is there an option to pre-compile these JSPs at the server startup time? That way, the user does not see the slow performance when he loads the GUI first time.

    Thanks,
    Sudhir
    If you set <webContainer deferServletLoad="false"/> in the server.xml, this will translate/compile the jsps on server startup.
  • saj
    saj
    4 Posts

    Re: JSP pages load very slowly in Liberty profile

    ‏2012-09-25T16:01:59Z  
    <webContainer deferServletLoad="false"/> does not affect when JSP is compiled, just when servlets are loaded:
    http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/index.jsp?topic=%2Fcom.ibm.websphere.wlp.nd.doc%2Ftopics%2Ftwlp_servlet_load.html
    Already had this set in server.xml and JSP slow to load.
  • R.Goff
    R.Goff
    6 Posts

    Re: JSP pages load very slowly in Liberty profile

    ‏2012-09-25T21:39:42Z  
    • saj
    • ‏2012-09-25T16:01:59Z
    <webContainer deferServletLoad="false"/> does not affect when JSP is compiled, just when servlets are loaded:
    http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/index.jsp?topic=%2Fcom.ibm.websphere.wlp.nd.doc%2Ftopics%2Ftwlp_servlet_load.html
    Already had this set in server.xml and JSP slow to load.
    You need both deferServletLoad and prepareJSPs.
  • Jacek_Laskowski
    Jacek_Laskowski
    133 Posts

    Re: JSP pages load very slowly in Liberty profile

    ‏2012-09-26T13:19:31Z  
    Hi,

    Where did you find the attribute?! I can't seem to find it in Liberty profile Configuration elements in the server.xml file.

    Does this mean that I could use the full WAS's JspBatchCompiler? What about the other attributes as described in Pre-touch tool for compiling and loading JSP files?

    I love learning tools through their undocumented features! :)

    Jacek
    Japila :: verba docent, exempla trahunt
    Hi,

    As a follow-up to the discussion, I wrote a short document about using the OSGi console to uncover what's covered - WebSphere 8.5 Liberty Profiles internals with OSGi console. I appreciate your comments.

    Jacek
    Japila :: verba docent, exempla trahunt