-
1. Re: Infinispan on Jboss 510 - Low performance issue or missing conf?
asimoes Sep 9, 2011 1:53 PM (in response to asimoes)I accidentally pressed assumed answered, and now i can't change it.
Sorry, but i still waiting some tips.
-
2. Re: Infinispan on Jboss 510 - Low performance issue or missing conf?
filipe_c Sep 12, 2011 5:28 AM (in response to asimoes)Hi,
nobody there check this, this is true?
filipe
-
3. Re: Infinispan on Jboss 510 - Low performance issue or missing conf?
manik Sep 12, 2011 2:06 PM (in response to filipe_c)What are you using Infinispan for? Hibernate/JPA 2nd level cache?
-
4. Re: Infinispan on Jboss 510 - Low performance issue or missing conf?
asimoes Sep 13, 2011 4:10 AM (in response to manik)Hi.
Yes, i'm using it as 2LC
This is my persistence.xml
-
persistence.xml 4.7 KB
-
-
5. Re: Infinispan on Jboss 510 - Low performance issue or missing conf?
galder.zamarreno Sep 13, 2011 5:47 AM (in response to asimoes)First of all, to avoid confusion, I'd remove all hibernate.cache.region.jbc2.* properties that belong to another cache provider.
I think the key here is hibernate.cache.infinispan.use_synchronization which you have set it to false. We've seen performance increase quite noticeably when that parameter is true. In fact, true is the default value and so I'd remove this property altogether. Let the Hibernate/Infinispan layer decide what's best here
Tbh, you really need these params:
<property name="hibernate.cache.use_second_level_cache"value="true" /> <property name="hibernate.cache.use_query_cache" value="true" /> <property name="hibernate.cache.region.factory_class"value="org.hibernate.cache.infinispan.InfinispanRegionFactory" /> <property name="hibernate.transaction.manager_lookup_class"value="org.hibernate.transaction.JBossTransactionManagerLookup" />
The rest of hibernate.cache.infinispan.* I'd leave out until you have the performance you want, and then you can tweak it further.
-
6. Re: Infinispan on Jboss 510 - Low performance issue or missing conf?
asimoes Sep 13, 2011 12:28 PM (in response to galder.zamarreno)Hi.
You are right, hibernate.cache.region.jbc2 do not belong here!
I done what you said, but the results are the same...
Any other clue?
-
7. Re: Infinispan on Jboss 510 - Low performance issue or missing conf?
galder.zamarreno Sep 14, 2011 2:55 AM (in response to asimoes)Hmm, that's weird. We can try isolating the problem, for example disabling query cache and see what the results are like.
Maybe you wanna upload your app and test class here?
-
8. Re: Infinispan on Jboss 510 - Low performance issue or missing conf?
asimoes Sep 14, 2011 4:35 AM (in response to galder.zamarreno)Ok.
I thing is better send the all project zipped.
-
Infinispan.zip 10.4 KB
-
-
9. Re: Infinispan on Jboss 510 - Low performance issue or missing conf?
asimoes Sep 14, 2011 11:02 AM (in response to galder.zamarreno)In the previous post i forgot to send you the client source... Sorry.
Meanwhile I made some tests. Here are the results:
********************* JBOSS CODE ***************************
public List<TUsers> getTUsersFindAll(int firstResult,int maxResults) { long start = System.currentTimeMillis(); Query query = em.createNamedQuery("TUsers.findAll"); if (firstResult > 0) { query = query.setFirstResult(firstResult); } if (maxResults > 0) { query = query.setMaxResults(maxResults); } List result = query.getResultList(); //Table users has two users!!!! System.out.println(System.currentTimeMillis() - start); return result; }
public List<TUsers> getTUsersFindNothing(int firstResult,int maxResults) { long start = System.currentTimeMillis(); List<TUsers> usrlst = new ArrayList<TUsers>(); for(int i=0;i<2;i++) { usrlst.add(new TUsers()); } System.out.println(System.currentTimeMillis() - start); return usrlst; }
********************* EXTERNAL CLIENT CODE *************************** private void makeNRequests(int numbReq, boolean findAll) { for (int j = 0; j < numbReq; j++) { List<TUsers> result; if (findAll) result = userFac.getTUsersFindAll(-1, -1); else result = userFac.getTUsersFindNothing(-1, -1); if (result == null || result.size()<1) System.out.println("null result!!!"); } }
********************* TEST (ABSOLUTE BEST TIME RESULTS)
*************************** ############# No cache enabled #################
Infinispan_Example.jar
makeNRequests(200, true); -> 2364 ms
[STDOUT] less than 5
makeNRequests(200, false); -> 1701 ms
[STDOUT] 0
InfinispanEar-1.0.ear
makeNRequests(200, true); -> 2299 ms
[STDOUT] 1 or 0
makeNRequests(200, false); -> 1761 ms
[STDOUT] 0
############# EHCACHE enabled #################
Infinispan_Example.jar
makeNRequests(200, true); -> 1750 ms
[STDOUT] 1 or 0
makeNRequests(200, false); -> 1549 ms
[STDOUT] 0
InfinispanEar-1.0.ear
makeNRequests(200, true); -> 1760 ms
[STDOUT] 1 or 0
makeNRequests(200, false); -> 1669 ms
[STDOUT] 0
############# INFINISPAN enabled #################
Infinispan_Example.jar
Not possible!
InfinispanEar-1.0.ear
makeNRequests(200, true); -> 10703 ms
[STDOUT] 1 or 0
makeNRequests(200, false); -> 1658 ms
[STDOUT] 0
It seems like a infinispan specific problem!!!
-
10. Re: Infinispan on Jboss 510 - Low performance issue or missing conf?
asimoes Sep 14, 2011 11:18 AM (in response to asimoes)Another thing.
This problem occurs when we call TUsersFacade EJB from its remote interface or when we call it from its local interface but inside another EJB
If I run the previous test code makeNRequests(200, true); in the JBOSS server, and I call it directly from TUserFacadeBean I got 12 ms time
but if I use injection in another bean on the server:
@IgnoreDependency @EJB(mappedName="TUsersFacade/local") TUsersFacadeLocal userFac;
I got 9500 ms time!!!
-
11. Re: Infinispan on Jboss 510 - Low performance issue or missing conf?
asimoes Sep 14, 2011 12:10 PM (in response to asimoes)I made some cpu sampling on JBOSS and i found that, in "low performance" case, there are a method that takes almost all cpu time ().
com.arjuna.ats.internal.arjuna.objectstore.ShadowingStore.write_state()
-
12. Re: Infinispan on Jboss 510 - Low performance issue or missing conf?
filipe_c Sep 21, 2011 4:56 AM (in response to galder.zamarreno)no ideas?
-
13. Re: Infinispan on Jboss 510 - Low performance issue or missing conf?
asimoes Sep 23, 2011 5:42 AM (in response to galder.zamarreno)@Galder Zamarreño
Any clue about what i'm doing wrong?
-
14. Re: Infinispan on Jboss 510 - Low performance issue or missing conf?
galder.zamarreno Oct 4, 2011 10:11 AM (in response to asimoes)Guys, I've said it before. You need to enable the use of synchronizations (as opposed to XA transaction)
So either *enable use_synchronization*:
<property name="hibernate.cache.infinispan.use_synchronization" value="true" />
Or remove it alltogether! (default is true)
Your zip file still says that's false, so XA transactions are being in use which result in storing transactions for recovery which does not make sense for 2LC.
Stick to defaults that are there for a reason