Forums Register Login

javaURLContextRoot.lookup called many times by JSF/Richfaces. CPU Usage is 100%.

+Pie Number of slices to send: Send
Technology used in UI is JSF Richfaces & Seam.
Number of concurrent users are 300-400.
Application is of midium size with 20-30 screens.

While doing performance testing we found that "javaURLContextRoot.lookup" is being called 30-40 times per screen for a user. Even on simple onchange listener ajax call 10-15 times lookup() is called.

Looks like its called by richfaces. Its causing to much CPU utilisation: mostly around 97-100% (with 300 users).

I will be gratefull if someone can show me a way to fix this high CPU Usage. I am pretty good in web layer development but never experienced things like this. I have 7-8 months exp in JSF & Richfaces.

Thanks in advance.
+Pie Number of slices to send: Send
Hi and welcome to the JavaRanch.

CPU usage is meaningless. If I run an application with 50 users on my laptop I'll get the same cpu usage.
How much time is spend in this method and why do you think that it is invoked to many times?
+Pie Number of slices to send: Send
We are using HP Diagnostics to see which methods is called how many times. Thats showed us the lookup being called so many times. And its around 20000 times for 300 users just doing a simple search after loggin in.

Our company enforces us to make sure CPU is not crossing a defined limit. Not sure whats the limit but it should be belore 70% i think.

I just dont know if lookup is really neccesary by richfaces or its something which we can control or improve.

Thanks a lot for replying.
+Pie Number of slices to send: Send
Considering that every J2EE webapp resides under a URL Context root which is the anchor for each and every resource in the webapp, I don't find it surprising that that particular function is very popular.

On the other hand, I would look more closely to make sure that the function that you THINK is consuming the CPU is really the one that DOES consume the CPU.

I can't fault 70% as a safety margin for webapp operation. Management may press employees to "give 110%", but pull that stunt on machines, and they'll quickly show you what happens when you don't have reserve capacity. I can tolerate 80-85% myself, but that's because I'm in charge of overall keeping things in line and not depending on people who working at 110% to step in when the pressure begins to build.

While it's possible that you can tune some of the higher-level functions to reduce the overall CPU consumption, you might also simply be demanding more than the hardware/software platform can give. I've never been all that certain that I could call JSF a "lightweight" framework, and 300 concurrent users is definitely not casual use.

Fortunately, JSF allows intermingling technologies. If a particular function requires too much, you can swap it out for something more performant, such as Struts or even raw servlet/JSP without having to scrap the parts of the JSF app that don't have that limitation.
He does not suffer fools gladly. But this tiny ad does:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1403 times.
Similar Threads
JSF scalability
Can you explain how to do load testing in JSF using Jmeter ??
Is JSF replacing Struts
performence problem
nio maxing CPU usage
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 09:16:08.