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.  [ 2 posts ] 
Author Message
 Post subject: response latency
PostPosted: Mon Mar 06, 2006 9:40 am 
Beginner
Beginner

Joined: Sat Jan 01, 2005 12:18 pm
Posts: 23
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.0.5
Database: Postgres 8.1

Is there any way to reduce the latency for querying?

I have got a huge number of queries that are generated as simple select statements by hibernate. One select statement needs approx 30ms to return back a result and if I have got 1000 of them then I get a response time of 30000ms (30secs).

If I execute those 1000 select statements with psql or pgAdmin it takes about 50ms to generate a result.

I already tried to use pooled connection using org.apache.commons.dbcp.BasicDataSource but the performance gain is marginal and not notworthy.

Another thing I tried ist to deactive transaction services at all but I got no better results.

What other ways do I have to improve latency performance using Hibernate?

Such latency times using hibernate makes the use of databases useless from my point of view.


Top
 Profile  
 
 Post subject: 2c
PostPosted: Tue Mar 07, 2006 2:07 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
I would suggest investigating and eliminating causes for so many queries by converting multiple queries into batches or single selects. For example by adjusting fetch policy from select to join.
Hope the links might help:
http://www.hibernate.org/315.html
http://www.hibernate.org/118.html (how to avoid n+1)
http://www.javalobby.org/articles/hiber ... e=archives

as the last resort you could use native SQL

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


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