Updating user role from users-permissions plugin is extremely slow

System Information
  • Strapi Version: 4.5.5
  • Operating System: Windows
  • Database: MySQL
  • Node Version: 14.20
  • NPM Version:
  • Yarn Version:

I’m trying to update the role of certain users by using Strapi entityService. The issue I’m having is that it takes extremely long before the user is succesfully updated. On average it takes about 3 minutes before I receive a response. I have about 9000 total users and 2200 users that have this specific role assigned.

I have tried using entityService and query engine but both of them show similar behaviour. I have also tried updating role instead of user content type but also similar results.

Anyone else who have experienced this issue and found a solution?

        const updatedUser = await strapi.entityService.update('plugin::users-permissions.user', vendorId, {
            populate: ['role'],
            fields: ['email'],
            data: {
                role: 3