[xwiki-devs] hibernate cache optimization?
Hello XWiki-devs, maybe this forum is better than curriki-dev. In short: how can I boost the size of the cache of objects held by hibernate? thanks in advance paul
as you know curriki.org is somewhat of a fat server serving really many requests.
One symptom we are seeing on the production machine only, almost, is: xwiki.getPlugin("curriki").fetchUserGroups(). that sometimes takes more than 1 minute and sometimes much less, all for the same user. On the development machine it takes time with users with a lot of groups only when the hibernate cache is flushed.
My interpretation is that this method is fetching the group and probably a lot more. My answer would be to go low-level.
But another answer would be to ensure that the hibernate cache is big enough so that all these stay in memory. Making this possible would also speed up a huge amount of other things.
Are we talking of the file ehcache.xml's attribute: maxElementsInMemory="10000" ? I sure could raise this by a factor 10 if true.
thanks in advance
paul
Not many answers down here. Let me ask a simpler question: is ehcache used per default? I seem to see a bit more about oscache... is this one rather used? Are both used? thanks in advance Paul Le 1 mai 2011 à 22:06, Paul Libbrecht a écrit :
Hello XWiki-devs,
maybe this forum is better than curriki-dev.
In short: how can I boost the size of the cache of objects held by hibernate?
thanks in advance
paul
as you know curriki.org is somewhat of a fat server serving really many requests.
One symptom we are seeing on the production machine only, almost, is: xwiki.getPlugin("curriki").fetchUserGroups(). that sometimes takes more than 1 minute and sometimes much less, all for the same user. On the development machine it takes time with users with a lot of groups only when the hibernate cache is flushed.
My interpretation is that this method is fetching the group and probably a lot more. My answer would be to go low-level.
But another answer would be to ensure that the hibernate cache is big enough so that all these stay in memory. Making this possible would also speed up a huge amount of other things.
Are we talking of the file ehcache.xml's attribute: maxElementsInMemory="10000" ? I sure could raise this by a factor 10 if true.
thanks in advance
paul
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Hi Paul, On Jul 20, 2011, at 9:33 PM, Paul Libbrecht wrote:
Not many answers down here.
Let me ask a simpler question: is ehcache used per default? I seem to see a bit more about oscache... is this one rather used? Are both used?
We're only using jbosscache. ehcache has never been used AFAIK, the other implementation that we have but that we're no longer using is oscache. Thanks -Vincent
thanks in advance
Paul
Le 1 mai 2011 à 22:06, Paul Libbrecht a écrit :
Hello XWiki-devs,
maybe this forum is better than curriki-dev.
In short: how can I boost the size of the cache of objects held by hibernate?
thanks in advance
paul
as you know curriki.org is somewhat of a fat server serving really many requests.
One symptom we are seeing on the production machine only, almost, is: xwiki.getPlugin("curriki").fetchUserGroups(). that sometimes takes more than 1 minute and sometimes much less, all for the same user. On the development machine it takes time with users with a lot of groups only when the hibernate cache is flushed.
My interpretation is that this method is fetching the group and probably a lot more. My answer would be to go low-level.
But another answer would be to ensure that the hibernate cache is big enough so that all these stay in memory. Making this possible would also speed up a huge amount of other things.
Are we talking of the file ehcache.xml's attribute: maxElementsInMemory="10000" ? I sure could raise this by a factor 10 if true.
thanks in advance
paul
Le 20 juil. 2011 à 21:50, Vincent Massol a écrit :
We're only using jbosscache. ehcache has never been used AFAIK, the other implementation that we have but that we're no longer using is oscache.
No more is like... it was the case back in that prehistoric day of xwiki 1.5.4? thanks in advance Paul
On 07/20/2011 03:50 PM, Vincent Massol wrote:
Hi Paul,
On Jul 20, 2011, at 9:33 PM, Paul Libbrecht wrote:
Not many answers down here.
Let me ask a simpler question: is ehcache used per default? I seem to see a bit more about oscache... is this one rather used? Are both used?
We're only using jbosscache. ehcache has never been used AFAIK, the other implementation that we have but that we're no longer using is oscache.
That's not right. jbosscache is used in XWiki's cache module, but ehcache is used internally by Hibernate. There are still some optimizations possible with Hibernate's use of cache, but that's a rather complex topic.
Thanks -Vincent
thanks in advance
Paul
Le 1 mai 2011 à 22:06, Paul Libbrecht a écrit :
Hello XWiki-devs,
maybe this forum is better than curriki-dev.
In short: how can I boost the size of the cache of objects held by hibernate?
thanks in advance
paul
as you know curriki.org is somewhat of a fat server serving really many requests.
One symptom we are seeing on the production machine only, almost, is: xwiki.getPlugin("curriki").fetchUserGroups(). that sometimes takes more than 1 minute and sometimes much less, all for the same user. On the development machine it takes time with users with a lot of groups only when the hibernate cache is flushed.
My interpretation is that this method is fetching the group and probably a lot more. My answer would be to go low-level.
But another answer would be to ensure that the hibernate cache is big enough so that all these stay in memory. Making this possible would also speed up a huge amount of other things.
Are we talking of the file ehcache.xml's attribute: maxElementsInMemory="10000" ? I sure could raise this by a factor 10 if true.
thanks in advance
paul
-- Sergiu Dumitriu http://purl.org/net/sergiu/
Le 21 juil. 2011 à 00:21, Sergiu Dumitriu a écrit :
Let me ask a simpler question: is ehcache used per default? I seem to see a bit more about oscache... is this one rather used? Are both used?
We're only using jbosscache. ehcache has never been used AFAIK, the other implementation that we have but that we're no longer using is oscache.
That's not right. jbosscache is used in XWiki's cache module, but ehcache is used internally by Hibernate. There are still some optimizations possible with Hibernate's use of cache, but that's a rather complex topic.
aaaaah. This is the one I am interested into: the one of hibernate. And indeed, all the abstraction kind of prevents me to be sure of things. Any way I can be sure ehcache is the one used? thanks in advance Paul
Here is how far I could get: The document cache: OSCacheCache cache = xwiki.xWiki.getStore().getCache(); seems pretty non-inspectable but is probably configured by xwiki.cfg. Is that correct? The hibernate object cache is controlled by each of the sessions which is controlled by the session-factory of which I can get a statistics: SessionFactoryImpl sessionFactory = xwiki.xWiki.getStore().getStore().getSessionFactory(); however the stats for the factory there seems pretty much empty. I must be doing something wrong. thanks for hints. This, to me, sounds to be a big big optimization possibility if we can have some monitoring mechanism. paul Le 21 juil. 2011 à 00:48, Paul Libbrecht a écrit :
Le 21 juil. 2011 à 00:21, Sergiu Dumitriu a écrit :
Let me ask a simpler question: is ehcache used per default? I seem to see a bit more about oscache... is this one rather used? Are both used?
We're only using jbosscache. ehcache has never been used AFAIK, the other implementation that we have but that we're no longer using is oscache.
That's not right. jbosscache is used in XWiki's cache module, but ehcache is used internally by Hibernate. There are still some optimizations possible with Hibernate's use of cache, but that's a rather complex topic.
aaaaah. This is the one I am interested into: the one of hibernate.
And indeed, all the abstraction kind of prevents me to be sure of things.
Any way I can be sure ehcache is the one used?
thanks in advance
Paul _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
participants (3)
-
Paul Libbrecht -
Sergiu Dumitriu -
Vincent Massol