-->
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.  [ 10 posts ] 
Author Message
 Post subject: Second-level caching speed
PostPosted: Wed Dec 01, 2004 9:17 pm 
Beginner
Beginner

Joined: Sun May 09, 2004 7:18 pm
Posts: 35
Hi,

I have a question about hibernte second-level caching. I am using OsCache as he cache provider. I am using Tomcat as application server, MySQL as DB server and they are on the same computer.

I turn on the general log for MySQL and I can see that the db hits number is decreased at least 6 times for the same page loading with caching. However, when I use JMeter to hit the same page, the output shown is only half time faster with caching. I configured the cache as memory caching.

I can understand that the speed can't be linear to the number of db hits. However, how can there be such a big differrence? Does it mean the memory caching also takes long time to retrieve information and almost takes the same time as database retrieval?

Could anybody share their performance gain with Caching + Hibernate?

Thanks a lot.

Ping


Top
 Profile  
 
 Post subject: Some Benchmark results
PostPosted: Mon Dec 06, 2004 8:41 am 
Beginner
Beginner

Joined: Tue Nov 30, 2004 6:19 am
Posts: 29
Location: Germany
Hi,


I've done some benchmarking and found some very suprising results (times in seconds):

Code:
            Standalone wo  Standalone with      JBoss wo       JBoss with
Persist              2,0               2,4           7,6             15,7
1. read, new ses     4,3               0,3          10,9              7,2
2. read JDBC direct  2,6               2,4           2,3                3


I tryed to persist and read 10.000 small objects (with and wo 2'nd Level Cache) and I've done this in standalone and JBoss environment. Suprisingly JBoss with 2'nd Level Cache took 6 times as long as standalone to persist. For reading from 2'nd Level cache, the difference is a lot larger.

Environment was: J2SDK1.4.2_01; winxp; MySql and JBoss3.2.6 running on same machine. For Standalone I used EHcache, in JBoss env. I used TreeCache.

My measurements support your finding: TreeCache brings not the huge speedup, as known from EHcache. For me it's a factor 2 or below.

I don't know wether and where I've done misconfiguration. If sombody is interested in, sources can be found on http://cvs.sourceforge.net/viewcvs.py/sens/Hibernate_JBoss3.2/ ... hints&help are very welcome.


Kind regards,
Michael


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 06, 2004 9:48 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
http://www.hibernate.org/Documentation/Benchmarks
http://www.hibernate.org/Documentation/PerformanceQA


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 06, 2004 10:16 am 
Beginner
Beginner

Joined: Tue Nov 30, 2004 6:19 am
Posts: 29
Location: Germany
After reading the mentioned links (no I won't blame on hibernate and yes, I know that the absolute numbers are not very meaningful), the question for the reason of the different results between standalone and JBoss environment stays still open for me.

Can you explain this suprising behaviour?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 06, 2004 12:22 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
I don't think anyone from the team has the time to evaluate your benchmark.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 06, 2004 12:25 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
For example TreeCache is a transactional cache, EHCache is not.


Top
 Profile  
 
 Post subject: Is there a supported benchmark?
PostPosted: Mon Dec 06, 2004 3:14 pm 
Beginner
Beginner

Joined: Tue Nov 30, 2004 6:19 am
Posts: 29
Location: Germany
Quote:
I don't think anyone from the team has the time to evaluate your benchmark.

Is there a benchmark supported by the hibernate team? I'm willing to evaluate your benchmark, if there is one!
[/quote]


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 06, 2004 3:52 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Not at the moment but its already on TODO. Not high priority though.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 06, 2004 5:12 pm 
Beginner
Beginner

Joined: Tue Nov 30, 2004 6:19 am
Posts: 29
Location: Germany
Is there something to continue or is this topic assigned to someone allready? I'm intrested in conributing.


Top
 Profile  
 
 Post subject: Found the solution to the strange numbers
PostPosted: Thu Jan 27, 2005 3:26 pm 
Beginner
Beginner

Joined: Tue Nov 30, 2004 6:19 am
Posts: 29
Location: Germany
Hi,

I found out that log4J configuration was the root cause for the suprising numbers. By switching the categories "org" and "net" to info, I got comparable results to the standolone numbers.

regards,
Michael


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 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.