User mapping - Throttle placeholder user creation
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
With the introduction of placeholder users, importers may create a considerable number of users in a short period of time, which can cause issues in GitLab.com. The users table is highly accessed and also has lots of indexes, which adds more overhead to Postgres when records are created.
This issue may be more problematic for third-party importers, such as GitHub Import, which processes many jobs concurrently. Depending on the scenario, each job may attempt to create a placeholder user.
This issue might be more important when premium users use the feature because they are allowed to create extra placeholder users. Below, you can find the number of placeholder users that can be created for each top-level group, depending on the plan and number of seats.
| GitLab.com plan | Number of seats | Placeholder user limit on top-level group |
|---|---|---|
| Free and any trial | Any amount | 200 |
| Premium | < 100 | 500 |
| Premium | 101-500 | 2000 |
| Premium | 501 - 1000 | 4000 |
| Premium | > 1000 | 6000 |
| Ultimate and open source | < 100 | 1000 |
| Ultimate and open source | 101-500 | 4000 |
| Ultimate and open source | 501 - 1000 | 6000 |
| Ultimate and open source | > 1000 | 8000 |
Proposed solution
Option 1
Introduce a throttling mechanism to limit the number of placeholder users created in a period.
Option 2
Only allow placeholder users to be created when the database is healthy.