authgear / authgear/authgear-server
Adding roles to group with a lot of user inside the group causes long response time
- Dominant language
- Go
- Stars
- 2k
- Forks
- 125
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 32
Description
1. We have a group with \~20000 users
2. Add a role to that group
3. See long response time
---
Guessing the time was spent on updating the user's `require_reindex_after` column, or enqueue tasks to reindex the users.
- [ ] Find the reason causing the long response time.
- [ ] If it is related to enqueue tasks, see if we can do it after returning the response.
Contributor guide
Research direction
Start at the group role-update entry point and trace how membership changes update users' require_reindex_after values or enqueue reindex tasks. Reproduce the update with a group containing about 20,000 users and profile the response path. Done means the cause of the long response is identified and, if background tasks are responsible, the response no longer waits for them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- authorization, backend, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100