Ray Augé 10 Years Ago Very nice work Kan!!!How close are you to implementing a full solution? Can you send me the pull request? (https://github.com/rotty3000) Please sign in to reply. Reply as... Cancel
Ray Augé 10 Years Ago .. oh, and is there a ticket created for the issue? If not, can you create one? Please sign in to reply. Reply as... Cancel
Ray Augé 10 Years Ago See http://issues.liferay.com/browse/LPS-35856I referenced your blog post See https://github.com/brianchandotcom/liferay-portal/pull/11487 Please sign in to reply. Reply as... Cancel Kan Zhang Ray Augé 10 Years Ago - Edited Cool The pull request is to add the cache layer which works well.I was also working on to reduce the following call--------(LayoutSet)ProxyUtil.newProxyInstance(PACLClassLoaderUtil.getPortalClassLoader(),new Class[] {LayoutSet.class},new LayoutSetStagingHandler(layoutSet));--------in LayoutSetLocalServiceStagingAdvice.wrapLayoutSet() because I don't like the fact the LayoutSetStagingHandler is being newed hundreds to thousands times in one single request.The LayoutStagingUtil.getLayoutSetStagingHandler(layoutSet) acts as a cache layer which works well when updating the layout because the layoutSet is already wrapped. But it does not work when reading the layoutSet from database.I was thinking to cache the LayoutSetStagingHandler to prevent it to be newed again and again. But I think it is not critical right now.Same thing happens in LayoutLocalServiceStagingAdvice for layouts too.One more thing, the LayoutSetLocalService.createLayoutSet(long layoutSetId) and the LayoutLocalService.createLayout(long plid) does not work because LayoutSetLocalServiceStagingAdvice/LayoutLocalServiceStagingAdvice has pointcut on it -- it tries to fetch the group object from the newly created Layout/LayoutSet (with groupId=0) which throws the NoSuchGroupException. Please sign in to reply. Reply as... Cancel
Kan Zhang Ray Augé 10 Years Ago - Edited Cool The pull request is to add the cache layer which works well.I was also working on to reduce the following call--------(LayoutSet)ProxyUtil.newProxyInstance(PACLClassLoaderUtil.getPortalClassLoader(),new Class[] {LayoutSet.class},new LayoutSetStagingHandler(layoutSet));--------in LayoutSetLocalServiceStagingAdvice.wrapLayoutSet() because I don't like the fact the LayoutSetStagingHandler is being newed hundreds to thousands times in one single request.The LayoutStagingUtil.getLayoutSetStagingHandler(layoutSet) acts as a cache layer which works well when updating the layout because the layoutSet is already wrapped. But it does not work when reading the layoutSet from database.I was thinking to cache the LayoutSetStagingHandler to prevent it to be newed again and again. But I think it is not critical right now.Same thing happens in LayoutLocalServiceStagingAdvice for layouts too.One more thing, the LayoutSetLocalService.createLayoutSet(long layoutSetId) and the LayoutLocalService.createLayout(long plid) does not work because LayoutSetLocalServiceStagingAdvice/LayoutLocalServiceStagingAdvice has pointcut on it -- it tries to fetch the group object from the newly created Layout/LayoutSet (with groupId=0) which throws the NoSuchGroupException. Please sign in to reply. Reply as... Cancel
Mahesh Panchal 10 Years Ago Hi Kan,Do you think same issue exist for com.liferay.portal.service.LayoutLocalService ?We have 2000 private pages and clicking Private pages tab in control panel or clicking select pages on publish window invokes following query 2000 times.select layoutimpl0_.plid as plid14_, layoutimpl0_.uuid_ as uuid2_14_, layoutimpl0_.groupId as groupId14_, layoutimpl0_.companyId as companyId14_, layoutimpl0_.createDate as createDate14_, layoutimpl0_.modifiedDate as modified6_14_, layoutimpl0_.privateLayout as privateL7_14_, layoutimpl0_.layoutId as layoutId14_, layoutimpl0_.parentLayoutId as parentLa9_14_, layoutimpl0_.name as name14_, layoutimpl0_.title as title14_, layoutimpl0_.description as descrip12_14_, layoutimpl0_.keywords as keywords14_, layoutimpl0_.robots as robots14_, layoutimpl0_.type_ as type15_14_, layoutimpl0_.typeSettings as typeSet16_14_, layoutimpl0_.hidden_ as hidden17_14_, layoutimpl0_.friendlyURL as friendl18_14_, layoutimpl0_.iconImage as iconImage14_, layoutimpl0_.iconImageId as iconIma20_14_, layoutimpl0_.themeId as themeId14_, layoutimpl0_.colorSchemeId as colorSc22_14_, layoutimpl0_.wapThemeId as wapThemeId14_, layoutimpl0_.wapColorSchemeId as wapColo24_14_, layoutimpl0_.css as css14_, layoutimpl0_.priority as priority14_, layoutimpl0_.layoutPrototypeUuid as layoutP27_14_, layoutimpl0_.layoutPrototypeLinkEnabled as layoutP28_14_, layoutimpl0_.sourcePrototypeLayoutUuid as sourceP29_14_ from Layout layoutimpl0_ where (layoutimpl0_.groupId=? )AND(layoutimpl0_.privateLayout=? )AND(layoutimpl0_.parentLayoutId=? ) order by layoutimpl0_.parentLayoutId ASC , layoutimpl0_.priority ASCNot sure why service class is not retrieving all layouts in one query and firing query for each ;ayout. Please sign in to reply. Reply as... Cancel Kan Zhang Mahesh Panchal 10 Years Ago - Edited Hi Mahesh,I double checked the source code and the layout has the cache enabled.Regarding to your issues, I think there are two possible causes:1. The max number of elements in cache is set too low in in your liferay ehcache xml. (By default the max number of elements in cache is 10000 for each entity ).2. The cache is cleared upon the layout(page) update. If you changed anything on the page, the cache will be cleared. Liferay will invokes the query first time when you go to the "Manage pages". But why it has so many queries (2000 time in your case)? Here is the reason:The "Manage pages" displays a tree view for the dropdown box for "copy to page" function and "link to page" page type. To generate the tree view, Liferay calls com.liferay.portal.util.LayoutLister.getLayoutView() to create the tree.In LayoutLister.getLayoutView(), it has a recursive method called _createList(long parentLayoutId, int parentId, int depth) which iterates thru the each of the layout to get the child layouts of each layout. If you have 2000 pages, it will call _createList_createList() 2000 times and you will have 2000 queries in the database.I am working to improve the above logic too, but recently I was overwhelmed by my work. Trying hard to find time... Please sign in to reply. Reply as... Cancel Mahesh Panchal Kan Zhang 10 Years Ago Hi Kan,Thanks for your explanation.Slowness of Manage Page seems to be due to LayoutLister.getLayoutView() and now we noticed that even clicking page from site navigation is causing 2000 DB calls. These calls seems to be for LayoutRevision and noticed that multiple calls are made for same layoutId.It looks like that LayoutRevision also need to be revisited Regarding ehcache point, I see that 10000 is max no of entries then 2000 layout should be OK, isn't it ? Please sign in to reply. Reply as... Cancel Kan Zhang Mahesh Panchal 10 Years Ago Hi Mahesh,10000 is max no of entries should be OK for 2000 layouts. So it is not the cache issue.Regarding the LayoutRevision concerns, it is caused by LayoutLocalServiceStagingAdvice.wrapReturnValue() - same reason as I mentioned in the blog post - but is for LayoutRevision insetad of LayoutSetBranch. But the LayoutRevision has the finder cache enabled, it only happens first time after you update a layout. Please sign in to reply. Reply as... Cancel
Kan Zhang Mahesh Panchal 10 Years Ago - Edited Hi Mahesh,I double checked the source code and the layout has the cache enabled.Regarding to your issues, I think there are two possible causes:1. The max number of elements in cache is set too low in in your liferay ehcache xml. (By default the max number of elements in cache is 10000 for each entity ).2. The cache is cleared upon the layout(page) update. If you changed anything on the page, the cache will be cleared. Liferay will invokes the query first time when you go to the "Manage pages". But why it has so many queries (2000 time in your case)? Here is the reason:The "Manage pages" displays a tree view for the dropdown box for "copy to page" function and "link to page" page type. To generate the tree view, Liferay calls com.liferay.portal.util.LayoutLister.getLayoutView() to create the tree.In LayoutLister.getLayoutView(), it has a recursive method called _createList(long parentLayoutId, int parentId, int depth) which iterates thru the each of the layout to get the child layouts of each layout. If you have 2000 pages, it will call _createList_createList() 2000 times and you will have 2000 queries in the database.I am working to improve the above logic too, but recently I was overwhelmed by my work. Trying hard to find time... Please sign in to reply. Reply as... Cancel Mahesh Panchal Kan Zhang 10 Years Ago Hi Kan,Thanks for your explanation.Slowness of Manage Page seems to be due to LayoutLister.getLayoutView() and now we noticed that even clicking page from site navigation is causing 2000 DB calls. These calls seems to be for LayoutRevision and noticed that multiple calls are made for same layoutId.It looks like that LayoutRevision also need to be revisited Regarding ehcache point, I see that 10000 is max no of entries then 2000 layout should be OK, isn't it ? Please sign in to reply. Reply as... Cancel Kan Zhang Mahesh Panchal 10 Years Ago Hi Mahesh,10000 is max no of entries should be OK for 2000 layouts. So it is not the cache issue.Regarding the LayoutRevision concerns, it is caused by LayoutLocalServiceStagingAdvice.wrapReturnValue() - same reason as I mentioned in the blog post - but is for LayoutRevision insetad of LayoutSetBranch. But the LayoutRevision has the finder cache enabled, it only happens first time after you update a layout. Please sign in to reply. Reply as... Cancel
Mahesh Panchal Kan Zhang 10 Years Ago Hi Kan,Thanks for your explanation.Slowness of Manage Page seems to be due to LayoutLister.getLayoutView() and now we noticed that even clicking page from site navigation is causing 2000 DB calls. These calls seems to be for LayoutRevision and noticed that multiple calls are made for same layoutId.It looks like that LayoutRevision also need to be revisited Regarding ehcache point, I see that 10000 is max no of entries then 2000 layout should be OK, isn't it ? Please sign in to reply. Reply as... Cancel Kan Zhang Mahesh Panchal 10 Years Ago Hi Mahesh,10000 is max no of entries should be OK for 2000 layouts. So it is not the cache issue.Regarding the LayoutRevision concerns, it is caused by LayoutLocalServiceStagingAdvice.wrapReturnValue() - same reason as I mentioned in the blog post - but is for LayoutRevision insetad of LayoutSetBranch. But the LayoutRevision has the finder cache enabled, it only happens first time after you update a layout. Please sign in to reply. Reply as... Cancel
Kan Zhang Mahesh Panchal 10 Years Ago Hi Mahesh,10000 is max no of entries should be OK for 2000 layouts. So it is not the cache issue.Regarding the LayoutRevision concerns, it is caused by LayoutLocalServiceStagingAdvice.wrapReturnValue() - same reason as I mentioned in the blog post - but is for LayoutRevision insetad of LayoutSetBranch. But the LayoutRevision has the finder cache enabled, it only happens first time after you update a layout. Please sign in to reply. Reply as... Cancel
Jens Meinecke 10 Years Ago Is this issue solved in EE? This is a no-go for our production environment. Please sign in to reply. Reply as... Cancel Ray Augé Jens Meinecke 10 Years Ago It would be really nice if the outstanding issues had tickets created with all these details attached and we can make sure that they get fixed and patches are created for EE.@Kan, Mahnesh, can you guys do that, then link them here so we can work on them please? Please sign in to reply. Reply as... Cancel Mahesh Panchal Ray Augé 10 Years Ago Hi Ray,It seems that LS has created ticket for this issue - http://issues.liferay.com/browse/LPS-36049. Please sign in to reply. Reply as... Cancel Matías Elola Mahesh Panchal 10 Years Ago Hi Mahesh,I want to know if you were able to solve the "Manage page" slowness on 6.1.1 CE GA2I'm working with almost 3000 public pages and, as you know, it turns very very slow when it comes to load/update layouts in the manage page section. I've read the ticket (LPS-36049) and it says that the problem is solved in 6.2.0 CE M6 but I'm looking for the solution for the 6.1.1 CE version.Do you know anything else about this problem and how to solve it in the latest stable community edition?Thank you very much Mahesh, and of course, thanks a lot to Kan who wrote this blog entry. Please sign in to reply. Reply as... Cancel Mahesh Panchal Matías Elola 10 Years Ago Hi Matias,We received patch from support for 6.1.20 EE version. Please sign in to reply. Reply as... Cancel Matías Javier Elola Mahesh Panchal 10 Years Ago Thanks Mahesh for your response.My co-worker found the solution last friday while I was out.For those who want to know, we have replaced the LayoutLister class with an improvement made by Raymond Auge in http://issues.liferay.com/browse/LPS-36049 (the same issue I've mentioned before).I think the next time I'll have to read more carefully.Thanks Ray. Please sign in to reply. Reply as... Cancel
Ray Augé Jens Meinecke 10 Years Ago It would be really nice if the outstanding issues had tickets created with all these details attached and we can make sure that they get fixed and patches are created for EE.@Kan, Mahnesh, can you guys do that, then link them here so we can work on them please? Please sign in to reply. Reply as... Cancel Mahesh Panchal Ray Augé 10 Years Ago Hi Ray,It seems that LS has created ticket for this issue - http://issues.liferay.com/browse/LPS-36049. Please sign in to reply. Reply as... Cancel Matías Elola Mahesh Panchal 10 Years Ago Hi Mahesh,I want to know if you were able to solve the "Manage page" slowness on 6.1.1 CE GA2I'm working with almost 3000 public pages and, as you know, it turns very very slow when it comes to load/update layouts in the manage page section. I've read the ticket (LPS-36049) and it says that the problem is solved in 6.2.0 CE M6 but I'm looking for the solution for the 6.1.1 CE version.Do you know anything else about this problem and how to solve it in the latest stable community edition?Thank you very much Mahesh, and of course, thanks a lot to Kan who wrote this blog entry. Please sign in to reply. Reply as... Cancel Mahesh Panchal Matías Elola 10 Years Ago Hi Matias,We received patch from support for 6.1.20 EE version. Please sign in to reply. Reply as... Cancel Matías Javier Elola Mahesh Panchal 10 Years Ago Thanks Mahesh for your response.My co-worker found the solution last friday while I was out.For those who want to know, we have replaced the LayoutLister class with an improvement made by Raymond Auge in http://issues.liferay.com/browse/LPS-36049 (the same issue I've mentioned before).I think the next time I'll have to read more carefully.Thanks Ray. Please sign in to reply. Reply as... Cancel
Mahesh Panchal Ray Augé 10 Years Ago Hi Ray,It seems that LS has created ticket for this issue - http://issues.liferay.com/browse/LPS-36049. Please sign in to reply. Reply as... Cancel Matías Elola Mahesh Panchal 10 Years Ago Hi Mahesh,I want to know if you were able to solve the "Manage page" slowness on 6.1.1 CE GA2I'm working with almost 3000 public pages and, as you know, it turns very very slow when it comes to load/update layouts in the manage page section. I've read the ticket (LPS-36049) and it says that the problem is solved in 6.2.0 CE M6 but I'm looking for the solution for the 6.1.1 CE version.Do you know anything else about this problem and how to solve it in the latest stable community edition?Thank you very much Mahesh, and of course, thanks a lot to Kan who wrote this blog entry. Please sign in to reply. Reply as... Cancel Mahesh Panchal Matías Elola 10 Years Ago Hi Matias,We received patch from support for 6.1.20 EE version. Please sign in to reply. Reply as... Cancel Matías Javier Elola Mahesh Panchal 10 Years Ago Thanks Mahesh for your response.My co-worker found the solution last friday while I was out.For those who want to know, we have replaced the LayoutLister class with an improvement made by Raymond Auge in http://issues.liferay.com/browse/LPS-36049 (the same issue I've mentioned before).I think the next time I'll have to read more carefully.Thanks Ray. Please sign in to reply. Reply as... Cancel
Matías Elola Mahesh Panchal 10 Years Ago Hi Mahesh,I want to know if you were able to solve the "Manage page" slowness on 6.1.1 CE GA2I'm working with almost 3000 public pages and, as you know, it turns very very slow when it comes to load/update layouts in the manage page section. I've read the ticket (LPS-36049) and it says that the problem is solved in 6.2.0 CE M6 but I'm looking for the solution for the 6.1.1 CE version.Do you know anything else about this problem and how to solve it in the latest stable community edition?Thank you very much Mahesh, and of course, thanks a lot to Kan who wrote this blog entry. Please sign in to reply. Reply as... Cancel Mahesh Panchal Matías Elola 10 Years Ago Hi Matias,We received patch from support for 6.1.20 EE version. Please sign in to reply. Reply as... Cancel Matías Javier Elola Mahesh Panchal 10 Years Ago Thanks Mahesh for your response.My co-worker found the solution last friday while I was out.For those who want to know, we have replaced the LayoutLister class with an improvement made by Raymond Auge in http://issues.liferay.com/browse/LPS-36049 (the same issue I've mentioned before).I think the next time I'll have to read more carefully.Thanks Ray. Please sign in to reply. Reply as... Cancel
Mahesh Panchal Matías Elola 10 Years Ago Hi Matias,We received patch from support for 6.1.20 EE version. Please sign in to reply. Reply as... Cancel Matías Javier Elola Mahesh Panchal 10 Years Ago Thanks Mahesh for your response.My co-worker found the solution last friday while I was out.For those who want to know, we have replaced the LayoutLister class with an improvement made by Raymond Auge in http://issues.liferay.com/browse/LPS-36049 (the same issue I've mentioned before).I think the next time I'll have to read more carefully.Thanks Ray. Please sign in to reply. Reply as... Cancel
Matías Javier Elola Mahesh Panchal 10 Years Ago Thanks Mahesh for your response.My co-worker found the solution last friday while I was out.For those who want to know, we have replaced the LayoutLister class with an improvement made by Raymond Auge in http://issues.liferay.com/browse/LPS-36049 (the same issue I've mentioned before).I think the next time I'll have to read more carefully.Thanks Ray. Please sign in to reply. Reply as... Cancel
gordon daniels 10 Years Ago Kan, thank you for this post and all your other contributions. I really like the bootstrap-theme too. I am learning alot from you.thanks again Please sign in to reply. Reply as... Cancel