Hello Guys,
We are facing one issue on PRODUCTION Environment, trying to import Groups from LDAP. Everything is working fine except the CPU Usage issue.
When the LDAP Import is trying to start the Group it goes to the CPU Usage of 200%+.
I found that in LDAP there is one Group in which there are 15k users.
And after digging in the code, I found that PortalLDAPImporterImpl.java
1
2protected void importUsers(final long ldapServerId, final long companyId, final LdapContext ldapContext, final Properties userMappings, final Properties userExpandoMappings,
3 final Properties contactMappings, final Properties contactExpandoMappings, final long userGroupId, final Attribute attribute)
4 {
5 ......
6 ............
7 UserLocalServiceUtil.setUserGroupUsers(userGroupId, ArrayUtil.toArray(newUserIds.toArray(new Long[newUserIds.size()])));
8 }
So, it was taking all the uerId(15K) in one Array
newUserIds and trying to add. So it was taking much time and also increasing the CPU Usage at this place.
If any one faced same problem then plz suggest the alternative for this.
Regards,
Amit Doshi