-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Performance Issue
PostPosted: Wed Mar 16, 2005 4:45 am 
Beginner
Beginner

Joined: Thu Dec 04, 2003 3:47 am
Posts: 31
Location: Hong Kong
Hibernate version:Hibernate 2.1

Name and version of the database you are using:MySQL 4.0.12

Testing Machine: Intel P4 2.8G, with 1G RAM, running WindowsXP


I'm testing and tunning the performance of the Hibernate Layer and the database in my application. I have an object in class A, with childrens and sub-childrens. In total, the no. of all objects / sub-objects under an object in class A is about 150. All the create/update/remove to the childrens (and sub-childrens) are done by cascading effects. I try to measure the performance of doing create / retrieve / update / delete. here is the metrics. All the units are in seconds

Let N be No. of objects in class A (actual no. of objects = N * 150)

N C R U D
100 10 2 10 5
200 36 4 35 10
300 74 6 77 18
400 138 8 161 23

some findings
1. time for Retrieval and Delete scales linearly, while for C and U do not
2. time for C and U are comparable

However, the performance degrades sharply when there are more than 500 objects. I wonder would it be caused by the session is always full of the newly created objects.

Anyway, i have set jdbc-batch-size to be 20, and disable the second level cache.

My question is, are those presented figures be resonable? Since I could not find any similar figures or benchmarking I can compare to. And actually , I'm not quite satisfactory about the performance. I'm not sure whether it would be useful to set the batch-size and second level cache (actually even i didn't set the batch-size, i got similar results), or I have missed something so that the batch updating is not fully utlized. Any suggestions how I can further tune my application, or about my data? Any reference or similar resources I can make comparison to or have more tunning tips? Thank very much for any comments.


Top
 Profile  
 
 Post subject: Batch Processing supported in Hibernate 2?
PostPosted: Wed Mar 16, 2005 4:55 am 
Beginner
Beginner

Joined: Thu Dec 04, 2003 3:47 am
Posts: 31
Location: Hong Kong
Also, I notice that in Hibernate 3 Reference Chapter 13. Batch Processing. Would those techniques be useful in Hibernate 2? Since I cannot find such chapter in Hiberante 2, but we can still set the jdbc.batch_size and whether to use the second level cache in Hiberante 2


Top
 Profile  
 
 Post subject: result after flushing and clearing the session regularly
PostPosted: Wed Mar 16, 2005 6:00 am 
Beginner
Beginner

Joined: Thu Dec 04, 2003 3:47 am
Posts: 31
Location: Hong Kong
I try to flush and clear the session regularly (say whenever 20 new objects under class A are created), and I got a much better result

N C R U D
100 7140 2719 6485 5375
200 11547 4141 12734 11297
300 16922 5875 19594 16843
400 22781 8297 27719 25297
500 28468 15594 34078 30625


it seems that flushing and clearing the session regularly is very important in such application. But i find that the result does not vary much when i set different jdbc_batch_size (or even do not set it). What's the reason? or becoz 1 object in class A already associated with 150 objects, so no matter how large is the batch size, it doesn't affect?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.