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?
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Joined: Aug 15, 2011
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.
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.
An IDE is no substitute for an Intelligent Developer.