フォーラム

ホーム » Liferay Portal » English » 3. Development

構造的に表示 平面上に表示 ツリー上に表示
スレッド数 [ 前へ | 次へ ]
toggle
Amit Doshi
CPU Usage issue on LDAP Group Import
2012/06/15 6:09
答え

Amit Doshi

ランク: Expert

投稿数: 491

参加年月日: 2010/12/29

最近の投稿

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
David H Nebinger
RE: CPU Usage issue on LDAP Group Import
2012/06/16 8:48
答え

David H Nebinger

ランク: Liferay Legend

投稿数: 4496

参加年月日: 2006/09/01

最近の投稿

Well, unfortunately I think you're stuck with it due to the size of the group.

The good news is that the creation of the 15k users would only occur once during the initial import.

The bad news is that with import enabled, Liferay will continue to pull the group and verify that the users exist and are still members of the group, so it's going to chug through those 15k users every time.
Amit Doshi
RE: CPU Usage issue on LDAP Group Import
2012/06/17 23:49
答え

Amit Doshi

ランク: Expert

投稿数: 491

参加年月日: 2010/12/29

最近の投稿

Thanks David for the Response.

Is there any way to deal with it ?

I am thinking that instead of adding all the 15k users at a single time in group. Can I make it in bunch of 500 users and run the for loop in order to add 15k users.

Is it efficient way to do it and also one more thing, will it make difference to the CPU Usage?

Regards,
Amit Doshi
David H Nebinger
RE: CPU Usage issue on LDAP Group Import
2012/06/18 5:25
答え

David H Nebinger

ランク: Liferay Legend

投稿数: 4496

参加年月日: 2006/09/01

最近の投稿

Your issue is the size of the ldap group. Liferay's still going to attempt to synchronize it regardless of how you create the 15k users. Besides, doing it yourself may only lead to problems rather than solutions.