UserAccessor.removeUsers takes a lot of time

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();
                        Group g = (Group);
                        groupManager.removeMembership(g, user);
                        LOG.debug("Removed membership="+g.getName());
                    LOG.debug(count+". Removed user=" + email);

Since I need to delete about 1000 users, this is taking a lot of time. Anybody know how to speed up the process?

1 answer

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):

Thanks for the reply Bruna. The latency is 1ms to 2ms. I also went and checked the cache tuning document:

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?



Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

1,030 views 51 8
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you