We are facing performance issue with liferay 6.2 after migrating from 6.1.
Almost all our custom as well as liferay's plugin portlet are responding very slow for non admin users
.
We observe that permission checks seems to be taking lot of time. Also following query is being hit so many times...
(
SELECT DISTINCT Group_.groupId AS groupId
,REPLACE(Group_.NAME, ' LFR_ORGANIZATION', '') AS groupName
,Group_.type_ AS groupType
,Group_.friendlyURL AS groupFriendlyURL
FROM Group_
INNER JOIN Users_Groups ON (Users_Groups.groupId = Group_.groupId)
WHERE (Group_.liveGroupId = 0)
AND (Group_.active_ = 1)
AND (Group_.liveGroupId = 0)
AND (Users_Groups.userId = 3391488)
AND (Group_.companyId = 10132)
AND (
Group_.classNameId = 10012
OR Group_.classNameId = 10024
)
AND (Group_.parentGroupId != - 1)
AND (Group_.liveGroupId = 0)
AND (Group_.NAME != 'Control Panel')
AND (
Group_.NAME LIKE NULL
OR NULL IS NULL
)
AND (
Group_.description LIKE NULL
OR NULL IS NULL
)
AND (Group_.type_ != 4)
)
UNION
(
SELECT DISTINCT Group_.groupId AS groupId
,REPLACE(Group_.NAME, ' LFR_ORGANIZATION', '') AS groupName
,Group_.type_ AS groupType
,Group_.friendlyURL AS groupFriendlyURL
FROM Group_
INNER JOIN Users_Orgs ON (Users_Orgs.organizationId = Group_.classPK)
WHERE (Group_.liveGroupId = 0)
AND (Group_.active_ = 1)
AND (Users_Orgs.userId = 3391488)
AND (Group_.companyId = 10132)
AND (
Group_.classNameId = 10012
OR Group_.classNameId = 10024
)
AND (Group_.parentGroupId != - 1)
AND (Group_.liveGroupId = 0)
AND (Group_.NAME != 'Control Panel')
AND (
Group_.NAME LIKE NULL
OR NULL IS NULL
)
AND (
Group_.description LIKE NULL
OR NULL IS NULL
)
AND (Group_.type_ != 4)
)
UNION
(
SELECT DISTINCT Group_.groupId AS groupId
,REPLACE(Group_.NAME, ' LFR_ORGANIZATION', '') AS groupName
,Group_.type_ AS groupType
,Group_.friendlyURL AS groupFriendlyURL
FROM Group_
INNER JOIN Groups_Orgs ON (Groups_Orgs.groupId = Group_.groupId)
INNER JOIN Users_Orgs ON (Users_Orgs.organizationId = Groups_Orgs.organizationId)
WHERE (Group_.liveGroupId = 0)
AND (Group_.active_ = 1)
AND (Group_.liveGroupId = 0)
AND (Users_Orgs.userId = 3391488)
AND (Group_.companyId = 10132)
AND (
Group_.classNameId = 10012
OR Group_.classNameId = 10024
)
AND (Group_.parentGroupId != - 1)
AND (Group_.liveGroupId = 0)
AND (Group_.NAME != 'Control Panel')
AND (
Group_.NAME LIKE NULL
OR NULL IS NULL
)
AND (
Group_.description LIKE NULL
OR NULL IS NULL
)
AND (Group_.type_ != 4)
)
UNION
(
SELECT DISTINCT Group_.groupId AS groupId
,REPLACE(Group_.NAME, ' LFR_ORGANIZATION', '') AS groupName
,Group_.type_ AS groupType
,Group_.friendlyURL AS groupFriendlyURL
FROM Group_
INNER JOIN Groups_UserGroups ON (Groups_UserGroups.groupId = Group_.groupId)
INNER JOIN Users_UserGroups ON (Users_UserGroups.userGroupId = Groups_UserGroups.userGroupId)
WHERE (Group_.liveGroupId = 0)
AND (Group_.active_ = 1)
AND (Group_.liveGroupId = 0)
AND (Users_UserGroups.userId = 3391488)
AND (Group_.companyId = 10132)
AND (
Group_.classNameId = 10012
OR Group_.classNameId = 10024
)
AND (Group_.parentGroupId != - 1)
AND (Group_.liveGroupId = 0)
AND (Group_.NAME != 'Control Panel')
AND (
Group_.NAME LIKE NULL
OR NULL IS NULL
)
AND (
Group_.description LIKE NULL
OR NULL IS NULL
)
AND (Group_.type_ != 4)
)
ORDER BY groupName ASC
Wondering why liferay is not caching it....
Search portlet
searches. – ArquebusdoGetPermissionQuery_6
within SearchPermissionCheckerImpl was our bottleneck, called multiple times (sometimes taking 2 minutes) for an overall execution over 20 minutes. The issue was a result of the number of UserGroups added in theif/else
(lines 304-328). In an EXT, we tailored those lines to fit our needs. – Arquebus