I am trying to remove certain users from confluence as a bulk operation. I see that a call to this method takes close to 30 sec for one user. To delete 50 users, it takes 25 min. UserAccessor.removeUsers removes the users association with groups before removing the user. I tried doing this myself but I dont see any performance improvement. This is the code i am using:
User user = userAccessor.getUserIfAvailable(email); if (user != null) { Pager<Group> pager = groupManager.getGroups(user); Iterator pgit = pager.iterator(); while(pgit.hasNext()){ Group g = (Group)pgit.next(); groupManager.removeMembership(g, user); LOG.debug("Removed membership="+g.getName()); } userAccessor.removeUser(user); LOG.debug(count+". Removed user=" + email); count++; }
Since I need to delete about 1000 users, this is taking a lot of time. Anybody know how to speed up the process?
Hi Shravan,
How is the database latency? (this information is set on your confluence logs).
If it's database related, check also for the Database connection pool (you might increase it and check if the delay decrease):
https://confluence.atlassian.com/display/DOC/Performance+Tuning
Thanks for the reply Bruna. The latency is 1ms to 2ms. I also went and checked the cache tuning document: https://confluence.atlassian.com/display/DOC/Cache+Performance+Tuning
Since this is a user deletion operation, I flushed the user related caches. I expected some performance improvement since the user deletion now wouldnt have to update the cache. But I was wrong. It took the same amount of time.
You see, in our dev server it is taking 30 sec to delete the user. But on our production server, it is taking 9 min to delete one user. And this is adding quite a bit of load on the server too.
Anything else I should try?
Thanks,
Shravan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.