wood burning stoves 2.0*
The moose likes Performance and the fly likes Performance tunning using J2EE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "Performance tunning using J2EE" Watch "Performance tunning using J2EE" New topic
Author

Performance tunning using J2EE

denny hau
Greenhorn

Joined: May 14, 2003
Posts: 4
Hallo,
My name is Denny and I have a problem with performance in J2EE. Ok, here is the description.
I am using IBM WebSphere 5.0 as the application server and Oracle 8.17 as the database. Both are in different box. My LAN is 10 MBps.
The Application Server computer is Pentium III 1 GHz, 1 GB memory. The Database server is Pentium III 800 MHz, 512 MB memory.
Application Architecture:
1. Front end: using Struts framework for web and a Swing client.
2. Middle layer: CMP Entity Bean and Stateless Session. Stateless Sessions are warped with Access Bean. I also use DAO Pattern
3. Data: Oracle Thin client for the DataSource – non XA. Some tables have about 80,000 rows.
I tested for single client access using web. The test was querying for a table in database and renders the result into web screen. The data for the table is about 80,000 rows and I only showed 100 rows for each pages (paging). The time required to do this is around 20 – 30 seconds.
The flow: Web->AccessBean->SessionBean(using JDBC)->Database->And back to Web accordingly.
But, when I tested it for multiple concurrent users (let’s say 50 users), the performance degraded very badly. I think it was approximately 15 minutes average. With some time out exceptions (after 120 sec), SQLException: protocol violation (?) and CORBA Out of memory exception.
I use JMeter to do the test.
Here’s some of the configuration in the App Server.
1.JVM: JIT disable, Heap Size Min 256 MB, Heap Max 512 MB. Garbage collection verbose mode=off.
2.Web Container: Servlet caching enables. Min Servet Serving = 20, Max = 50.
3.EJB Container: EJB Buckets = 4016 buckets
4.DataSouce: Min Connection=20, Max=50. Transaction timeout=120sec.
5.ORB: pass by reference=off. I didn’t do modification in ORB setting, leave it as default
The CPU utilization was near 100 % during the requests processing. Memory resources were around 512 to 1,000 MB. I found it strange to see the Memory resource indicator still pointing high memory usage after the test. I mean that the Garbage collector seemed unable to reclaim/freeing the memory.
The query method looks like this:
-Get DataSource
-Get connection – CONCUR READ ONLY, TYPE SCROLL INSENSITIVE
-Construct SQL Query based on user’s criteria (the ‘where’ clause); in this test lets assume we don’t use criteria
-Get ResultSet
-Set ResultSet’s fetch size to 10,000
-Construct a collection of Model (Value Object)
-Point ResultSet to last row and get the last row position to get total rows. (easier than querying for select count(*) … )
-Return Result to caller.
What do I miss here? Please help…… Sorry for writing such a long question
~desperateMan
Loren Rosen
Ranch Hand

Joined: Feb 12, 2003
Posts: 156
Even under the best of circumstances its going to take time to ship around that many rows. While we can probably make that somewhat faster, first we ought to ask if we need to do it all. Can you instead use ROWNUM to limit the query to the rows you're actually going to display?
 
 
subject: Performance tunning using J2EE