java - Extremelly high CPU usage in JSF application -
i wanted ask advice possible performance improvements of jsf based application. using mojarra implementation 2.2.7. along it, have hibernate (4.2.7.final), spring (3.2.3.release), component library proimefaces (4.0) , utility library omnifaces (1.8), not in focus here. deploying on jetty server 8.0.0.m0 testing purpose, , on tomcat 7,0 in production.
our interface relatively complex has many components , dialogs. try keep code distinct components in separate beans. have used request scoped beans possible, ended many view scoped beans reason need interact data inside components , dialogs , results of interactions displayed via ajax (for instance, when liking something, update count; when following person, update status etc.). in total, there 25 view scoped beans used on 1 page (i monitored initialisation in method annotated @postconstruct). also, sustained of having many composite components, necessary (around 15 of them, several of them used multiple times).
we developed jmeter stress test check application performance. however, on amazon m1.medium instance cpu load reached 100% 4 parallel users, , requests failed. in order identify problem, profiled locally 1 real user performing basic application operations. results indicate significant cpu usage on 2 methods: - javax.faces.application.viewhandlerwrapper.restoreview (30-40%) - org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter (25-30%)
looking @ jprofiler call graph, hot spots , call tree didn’t identify of custom methods have significant influence on such cpu use.
these results worse @ beginning after reading , applying of advices found related jsf performance managed improve slightly, , result of changing scopes of beans , removing components not necessary.
we have tried setting javax.faces.state_saving_method both 'client' , 'server', didn't improvements. our current web.xml: https://db.tt/aw7l9zyi
comparing cpu use, heap use seems not problem. conclude question: issue related possible bad design of our code or performance issue jsf (mojarra implementation) has? issue in having many different (view scoped) beans used on 1 page? there else affect cpu use , should try in order fix issue? hope have advice, tried find on web , don’t have idea should next.
thanks
please try add thoses params
<context-param>// must find equivalent majorra <param-name>org.apache.myfaces.check_id_production_mode</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>javax.faces.project_stage</param-name> <param-value>production</param-value> </context-param> <context-param>// must find equivalent majorra <param-name>org.apache.myfaces.cache_old_views_in_session_mode</param-name> <param-value>soft</param-value> </context-param> <context-param> <param-name>javax.faces.serialize_server_state</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>javax.faces.serialize_state_in_session</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>facelets.refresh_period</param-name> <param-value>999999</param-value> </context-param>
Comments
Post a Comment