Slow start-up for JSF projects on Sun Java System Application Server 8.2?
App. Server: Sun Java System Application Server 8.2
I really don't understand why a JSF project starts-up so slow on Sun Java System Application Server 8.2.
I've gone through the "Overview of Sun Java System Application Server Performance" guide and tuned my server.
It's not memory or processor, I am developing on a SunOS 5.8 Generic_117350-27 sun4u sparc SUNW,UltraAX-MP.
The JSF project contains one index.jsp and one login.faces - that's it. But it takes up towards 15 seconds to load the page, if I type:
http://<domain>:8080/login/
I would believe that the application should be a lot faster.
What can I do to solve this?
Thanks,
--Todd
[714 byte] By [
jtp512a] at [2007-10-3 2:19:36]

Is this everytime when you opens the page? Or everytime only directly after a fresh start of the appserver? If the latest is the case, then yes, this is normal. All code have to be compiled before being executed on the appserver. But this "slowdown" should occur at the first time of opening after a fresh start of the appserver only.
BalusC: Everytime only directly after a fresh start of the appserver.(Sorry, I didn't specify that earlier.)Understood your answer.Thanks,--Todd
Todd,
I'm using Websphere, but noticed the same problem with my JSF app. BalusC is correct about why it slows down. Here's how to get around it.
You can pre-compile your JSPs. I have upwards of 30 pages in my app that just about every user would view in succession, and it is unacceptable that the first user have to load all of them. So I pre-compile all the JSPs on startup of the app. Works perfectly!
In your web.xml put this in for each page you want to pre-compile:
<servlet>
<servlet-name>PageName</servlet-name>
<display-name>PageName</display-name>
<jsp-file>/JSPName.jsp</jsp-file>
<load-on-startup>-1</load-on-startup>
</servlet>
That's it. Note: Pre-compiling your JSPs on startup will increase the application startup time substantially.
Hope this helps!
CowKing
CowKing:
Thank you, I've added the following to my web.xml file:
<!-- Preload -->
<servlet>
<servlet-name>PETRO ADMIN Transaction Browser</servlet-name>
<jsp-file>/transactionbrowser.jspx</jsp-file>
<load-on-startup>-1</load-on-startup>
</servlet>
This didn't help, I still have a twelve second start-up time. I need to go back and look at the Sun Java System Application Server docs...
Thanks again for the advice!
--Todd
Weird... Are you pre-loading the Faces Servlet too?
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>-1</load-on-startup>
</servlet>
I suppose it could just be a difference in web servers.
CowKing
Yes I am.
Right now I have:
<!-- Faces Servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup> -1 </load-on-startup>
</servlet>
<servlet>
<servlet-name>Persistent Faces Servlet</servlet-name>
<servlet-class>com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet</servlet-class>
<load-on-startup> 1 </load-on-startup>
</servlet>
<servlet>
<servlet-name>Blocking Servlet</servlet-name>
<servlet-class>com.icesoft.faces.webapp.xmlhttp.BlockingServlet</servlet-class>
<load-on-startup> 1 </load-on-startup>
</servlet>
<!-- Preload -->
<servlet>
<servlet-name>Transaction Browser</servlet-name>
<jsp-file>/transactionbrowser.jspx</jsp-file>
<load-on-startup> 1 </load-on-startup>
</servlet>
It still doesn't work, so you may be right.
Thanks,
--Todd
Make sure all the load-on-startup values are "-1" instead of "1". Including the extra servlets like the "Persistent Faces Servlet".In your first example posted you had it correct, but it's been changed in the web.xml code you posted above.CowKing