-->
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.  [ 4 posts ] 
Author Message
 Post subject: OGM-infinispan very slow entity persistence post-processing
PostPosted: Tue Apr 12, 2016 4:50 pm 
Newbie

Joined: Tue Apr 12, 2016 4:09 pm
Posts: 9
I'm using OGM 5.0.CR1 on Wildfly 10. I have a service that loads on app startup and persists a couple thousand entities. According to log output, it only takes a couple hundred milliseconds to persist all the entities. However, if I use a non-persistent Infinispan data store, there's about 4 minutes of time from when the loader service method completes and when the app goes to the "started" state. The more data I persist, the longer this period of time becomes. This doesn't happen if I switch to the "map" data store - the app goes to the started state right after loader service completes.

I assume that OGM and/or Lucene are doing a bunch of work on the data (transaction management, indexing, etc). But why does it take so long? Is there any way I can enable debugging output to get a better idea of what's going on?


Top
 Profile  
 
 Post subject: Re: OGM-infinispan very slow entity persistence post-processing
PostPosted: Wed Apr 13, 2016 6:21 am 
Hibernate Team
Hibernate Team

Joined: Sat Jan 24, 2009 12:46 pm
Posts: 388
Hi,

You can increase the logging to INFO or DEBUG (e.g. by specifying log4j.logger.org.hibernate=info in log4j.properties in case you are working with Log4j). 4 min definitely sounds too long for a couple of thousand inserts. Alternatively, if you can provide a small Maven project exposing this issue, I'll be happy to take a look.

Thanks!

--Gunnar

_________________
Visit my blog at http://musingsofaprogrammingaddict.blogspot.com/


Top
 Profile  
 
 Post subject: Re: OGM-infinispan very slow entity persistence post-processing
PostPosted: Wed Apr 13, 2016 5:15 pm 
Newbie

Joined: Tue Apr 12, 2016 4:09 pm
Posts: 9
I've changed logging level to DEBUG. Here are my observations... I'm running in Wildfly 10 and my loader service is a transactional EJB method which should flush entities automatically. I am seeing the entities persisted. However, I only see more debugging output from Hibernate if I manually call entityManager.flush(), but nothing that indicates problems.

Also, debugging output ends just after my entity loader service completes. I'm still left with a 4 minute wait time before my app goes to the started state. During that time, I see no debugging output.

I tried switching to a redis data store. I see my entities get persisted in redis just fine, but the after-persistence wait time is over 5 minutes and I get a java.util.concurrent.TimeoutException. To see if it made a difference, I tried switching Lucene indexes to be in infinispan rather than file-based, but having some trouble with class loading.

My entity model is fairly complex with lots of associations, elementcollections of maps, etc. I'll try to disable some of these to see if I can spot a bottleneck. Any debugging tips you could give me would be appreciated.


Top
 Profile  
 
 Post subject: Re: OGM-infinispan very slow entity persistence post-processing
PostPosted: Thu Apr 14, 2016 6:28 am 
Hibernate Team
Hibernate Team

Joined: Sat Jan 24, 2009 12:46 pm
Posts: 388
What do you mean by "wait time before my app goes to the started state"? If your app isn't started, how are you inserting these entities? You hit an interesting problem and I'd love to help, but it's really hard without knowing more details. If you e.g. remote debug the app, maybe you can see any locks after the persist has happened? If you could isolate a small test case, we'll give it a look.

--Gunnar

_________________
Visit my blog at http://musingsofaprogrammingaddict.blogspot.com/


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