Using ECperf 1.0

   

Troubleshooting

Slow Performance from EJB Methods

When calling a method on my EJB, it takes a long time to return.

There can be many reasons for this, but detecting where the problem usually is easy. The best thing to do is to get one of the performance tools mentioned in Table 18.1 and start up your EJB server with the tool. Then, call the slow-performing method and use the tool to analyze where most of the time is being spent during the call. When you figure out which method or methods are causing the problems, modify the code and rerun the tests until you get acceptable performance levels.

Unacceptable Scalability

When I load test my EJB, it performs terribly when the number of virtual users is more than a few.

There can be several reasons why your application doesn't scale properly, but typically it's related to one or more bottlenecks in the application. Commonly, the cause of the bottleneck is due to multiple clients or threads competing for the same resource. The resource might be a database connection (if you haven't used a datasource correctly) or it might be a propriety resource of your own design. One common bottleneck is when a class uses the synchronized keyword and possibly implements the Singleton pattern. Finding the offending method or methods that is limiting the scalability is much harder than finding performance problems. When you do find the problem, make some changes to the code or design and rerun the tests. Be sure to run the tests several times and look at the averages and not just take the first result set. With EJB and Web applications, data might not be cached yet on the first run, and you might get skewed results if you include the first sample. Normally, you'll want to make a few calls first and then take a sample.



Special Edition Using Enterprise JavaBeans 2.0
Special Edition Using Enterprise JavaBeans 2.0
ISBN: 0789725673
EAN: 2147483647
Year: 2000
Pages: 223

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net