Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I, perhaps, made a wrong choice of going with a Component-based Framework like JSF for an internet facing, high traffic web application. Development with JSF has although been easier but what I fear now is whether JSF would allow me that scalability & performance with all it fundamental problems & issues. State saving in a high traffic web app, does that make sense at all!?

How do I tune up my JSF app now to make it perform better under heavy load? I am already trying to reduce the state / component tree by reducing the no of components on page. What are other things I can tune up to make JSF app perform better ?

share|improve this question
    
Would you please tell us (more than one year later) about your application ? What solutions did you choose ? –  Laabidi Raissi Oct 21 '13 at 21:02
add comment

4 Answers

It would be a good idea to see what session scoped beans are necessary for the session and which can just be request scoped. Further, try to see where you can realistically clean up session scoped beans when you have finished with them as this will reduce session size.

If it is server memory that is out of control you can configure it to store session state on the client side, however this will increase the size of requests and responses through your servers so bandwidth may take a hit.

Likewise if bandwidth is the bottleneck then try storing session state on the server to reduce the request and response sizes.

Martijn is correct however, you should take the time to properly evaluate your performance bottlenecks with a proper profiling tool before pointing your finger at JSF. This very well may also be a database issue as well.

share|improve this answer
add comment

What performance characteristics are you trying to achieve?

  1. You should start with the threshold that is acceptable. For example, you don't want users to wait for more than 3 seconds for the login page to load.
  2. Then you need to create a time budget. For example, set timing points at the boundaries of your application (browser, application, DB etc) so you know exactly where the time is being spent.

Only then should you look to tune the individual components within your application architecture. JSF might not even be a problem :-)

share|improve this answer
add comment

A good start to understand how JSF performance works is take a look at this blog:

Understanding JSF 2 and Wicket: Performance Comparison

There is a test application with everything you need to tune JSF properly. It is quite simple because you usually only need to set javax.faces.PROJECT_STAGE web config param to Production and JSF will configure for you, but there are some additional config parameters that helps just a little.

share|improve this answer
add comment

There is one (possibly) significant performance problem with JSF: The creation of the "View" (the server-side representation of the page structure) is quite expensive.

At least the reference implementation (Mojarra) does this for every request. This means that there is a high (as in several 100 ms) overhead if you have a large page, even if you only update a part via AJAX.

One possible solution is "stateless JSF": http://industrieit.com/blog/2011/11/stateless-jsf-high-performance-zero-per-request-memory-overhead/

It's non-standard, but seems to work well.

share|improve this answer
1  
Yes stateless mode is a nice feature which has also been proposed to be added to JSF specification(java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1055). Looking forward to use this stateless implementation for my project. –  user01 May 22 '12 at 14:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.