• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Sachin Jha
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic