-
1. Re: ModeShape 3 with ISPN JDBC cache - MySQL vs H2 performance
rhauch Jan 21, 2013 11:41 AM (in response to psiroky)First of all, I'd suggest that you put the "loaders" section inside the "namedCache" area of the Infinispan configuration. The loader parameters are all cache-specific. It's a minor detail that won't really affect what you're doing now, but it's good practice when you deal with multiple caches for other ModeShape features.
A second suggestion is to try write-behind. I've done very little with it, but depending upon your configuration it might be worth a shot. It entails adding something like "<async enabled="true" threadPoolSize="10" />" as a child of the "loader" element.
Is the MySQL instance running on the same machine as the test? And I presume that the jackrabbit test results were using the same resources.
ModeShape uses transactions with Infinispan, and offhand I'm not sure how the JDBC cache stores integrate with them. I might suggest asking the Infinispan folks about it, in case they have any suggestions or configuration tweaks. (Please add a link to that discussion here, so that we can follow it.)
UPDATE: add the second suggestion.
-
2. Re: ModeShape 3 with ISPN JDBC cache - MySQL vs H2 performance
psiroky Jan 22, 2013 12:17 PM (in response to rhauch)Thanks for the suggestions. Database is local and the jackrabbit test is exactle same as the one running with modeshape.
I tried to use the write-behind approach, but I am getting following exception when trying to login into repository:
{code}Caused by: javax.jcr.RepositoryException: Error while starting 'Database-Persisted-Repository' repository: Object of type class org.infinispan.schematic.internal.SchematicEntryLiteral expected to be marshallable
at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:613)
at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:570)
at org.modeshape.jcr.JcrRepository.login(JcrRepository.java:149)
at org.drools.repository.modeshape.ModeShape3RepositoryConfigurator.login(ModeShape3RepositoryConfigurator.java:100)
at org.drools.repository.RulesRepositoryConfigurator.login(RulesRepositoryConfigurator.java:85)
at org.drools.guvnor.server.repository.RepositoryStartupService.newSession(RepositoryStartupService.java:219){code}
Found same issue in https://community.jboss.org/thread/200226, but the fix there is to use ISPN 5.1.4.FINAL, which did not work for me. Any idea how to fix this?
Just out of curiosity I also tried the use case with PostgreSQL, the time is still higher (~2 times), but its definitely faster than with MySQL. So from this it seems that the MySQL is just slower when dealing with requests from ModeShape (ISPN).
-
3. Re: ModeShape 3 with ISPN JDBC cache - MySQL vs H2 performance
rhauch Jan 22, 2013 9:31 AM (in response to psiroky)Petr, do you have the full stack trace for the exception? I'd like to know what Infinispan call resulted in that exception.
-
4. Re: ModeShape 3 with ISPN JDBC cache - MySQL vs H2 performance
psiroky Jan 22, 2013 12:13 PM (in response to rhauch)I wanted to attach full stack trace, but that is the only part that is logged (JBoss AS 6 server log). One thing I forgot is the first line above the exception:
ISPN000136: Execution error
org.infinispan.marshall.NotSerializableException: Object of type class org.infinispan.schematic.internal.SchematicEntryLiteral expected to be marshallable
I can try to tweak the config to log the entire stack trace, but I am not sure if that is possible.
-
5. Re: ModeShape 3 with ISPN JDBC cache - MySQL vs H2 performance
rhauch Jan 22, 2013 12:16 PM (in response to psiroky)But that's strange, because SchematicEntryLiteral can be serialized with an Infinispan externalizer: https://github.com/ModeShape/modeshape/blob/master/modeshape-schematic/src/main/java/org/infinispan/schematic/internal/SchematicEntryLiteral.java#L58
This sounds awfully like there's a classpath problem -- like Infinispan can't see the ModeShape (rather Schematic) externalizers. How did you deploy this to AS6?
-
6. Re: ModeShape 3 with ISPN JDBC cache - MySQL vs H2 performance
psiroky Jan 22, 2013 12:31 PM (in response to rhauch)Both ModeShape and Infinispan (and their dependencies) are embedded insinde war and that war is deployed. I double checked and I am currently using ModeShape 3.1.Final and infinispan-5.1.4.Final (tried 5.1.2 also).
There are no other infinispan or modeshape jars in entire server, so the classpath should contain correct jars.
-
7. Re: ModeShape 3 with ISPN JDBC cache - MySQL vs H2 performance
rhauch Jan 22, 2013 12:37 PM (in response to psiroky)Can you provide a test case or standalone test project that replicates this, and then log an issue?
Regarding your original question, your experience with MySQL appears to mirror mine: it is simply slower than other DBMSes. Again, perhaps the Infinispan folks have some recommendations for MySQL or cache store tweaks to improve performance.
-
8. Re: ModeShape 3 with ISPN JDBC cache - MySQL vs H2 performance
psiroky Jan 22, 2013 12:46 PM (in response to rhauch)I can try to "cut off" the code from Guvnor and see if it's working or not. If the exception won't go away then I will log the issue.
I asked my collegue that has exprerience with infinispan and he said that the poor performance is probably expected. He did not have any particular tunning suggestions so asking the infinispan guys seems to be right thing to do next.
Thanks for the time and suggestions so far, I really appreciate it.
-
9. Re: ModeShape 3 with ISPN JDBC cache - MySQL vs H2 performance
psiroky Jan 22, 2013 6:30 PM (in response to psiroky)As it turned out, the reproducer is rather simple. See https://issues.jboss.org/browse/MODE-1769 for more details.
The exception is thrown only when using the "async" feature, however I am not sure how that could be related.
-
10. Re: ModeShape 3 with ISPN JDBC cache - MySQL vs H2 performance
rhauch Jan 23, 2013 12:12 PM (in response to psiroky)1 of 1 people found this helpfulTurns out it was an Infinispan bug, but our 3.1.1.Final patch release will contain an automatic workaround. It shouldn't be a problem in 3.2, since that will depend on Infinispan 5.2.0.Final (or later) which should havce the fix for the original problem.
-
11. Re: ModeShape 3 with ISPN JDBC cache - MySQL vs H2 performance
psiroky Jan 24, 2013 8:07 AM (in response to rhauch)Thanks for the quick fix! Using the threadPoolSize set to 10 resulted into some infinspan locking exceptions (I did not investigated them further). I tried threadPoolSize set to 1 and that works as expected.
Also the performance using MySQL JDBC cache store is now really much better, comparable to H2.
-
12. Re: ModeShape 3 with ISPN JDBC cache - MySQL vs H2 performance
rhauch Jan 24, 2013 8:57 AM (in response to psiroky)Great news! Thanks for verifying the fix, too.
Any chance you can share your repository configuration and Infinispan configuration for the benefit of future readers?
-
13. Re: ModeShape 3 with ISPN JDBC cache - MySQL vs H2 performance
psiroky Jan 24, 2013 9:25 AM (in response to rhauch)Sure, configs (hopefully) attached to this message.