]
Thomas Heute updated GTNPORTAL-338:
-----------------------------------
Component/s: Performance
Assignee: Julien Viet
tune getAllPortalNames method in UserPortalConfigService
--------------------------------------------------------
Key: GTNPORTAL-338
URL:
https://jira.jboss.org/jira/browse/GTNPORTAL-338
Project: GateIn Portal
Issue Type: Bug
Components: Performance
Affects Versions: 3.0.0-Beta03
Reporter: Prabhat Jha
Assignee: Julien Viet
Priority: Critical
Fix For: 3.0.0-GA
Related jira is
https://jira.jboss.org/jira/browse/JBQA-2887 which may not be accessible
to all of you so here are details:
I did some profiling with JProfiler. There is no difference between the case with
different users and same users test. The biggest bottleneck is the
"getAllPortalNames" bottleneck. During processing of HTTP request to the sample
page, then about 90% of time is spent in method "getAllPortalNames" from class
"org.exoplatfrom.portal.config.UserPortalConfigService". Each call to this
method performs several calls to eXo JCR DB. There is no caching here.
Please let me know if a separate jira is needed for following profiling:
I tried to do the test and profiling with Chromattic options disabled and enabled.
Chromattic options are four JVM options which can be added to server JVM args to optimize
Chromattic library to use caching and avoid calls to eXo JCR DB. Namely these options are
here:
-Dorg.chromattic.api.Option.optimize.jcr.enabled=true
-Dorg.chromattic.api.Option.optimize.jcr.has_property.enabled=true
-Dorg.chromattic.api.Option.optimize.jcr.has_node.enabled=true
-Dorg.chromattic.api.Option.cache.state.enabled=true
I verified that there is no any performance improvement with these options enabled and
calls to eXo JCR SB are still here. I did some profling and debugging and here are the
more detailed results:
1) Significant amount of time is spent in the method getProperty in class
org.chromattic.core.jcr.SessionWrapperImpl.
public Property getProperty(Node node, String relPath) throws RepositoryException {
if (hasPropertyOptimized) {
return node.getProperty(relPath);
} else {
if (node.hasProperty(relPath)) {
return node.getProperty(relPath);
}
1.a) if chromattic options are disabled (hasPropertyOptimized==false to be more precise),
then method node.hasProperty(relPath) performs call to eXo DB but method
node.getProperty(relPath) doesn't perform any additional calls to DB, because data are
cached inside of cache in
org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWorkspaceDataManager.
1.b) if chromattic options are enabled, then only method node.getProperty(relPath) is
called but this method performs calls to DB because these data are not cached inside
CacheableWorkspaceDataManager.
So the conclusion is, that there is no any benefit when hasPropertyOptimized is true.
2) If cacheState is enabled (option -Dorg.chromattic.api.Option.cache.state.enabled=true)
then there is non-null variable "propertyCache" inside
"org.chromattic.core.PersistentEntityContextState". When method
"getPropertyValue" on class "PersistentEntityContextState" is called,
then nothing is found inside the cache and founded items are not saved to propertyCache.
New items are put to propertyCache only when "setPropertyValue" is called, but
this method is not called during HTTP request processing. So the propertyCache is always
empty.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: