goauthentik / authentik

The authentication glue you need.
https://goauthentik.io
Other
11.89k stars 819 forks source link

User synchronization from MS Active Directory too slow #6052

Closed medir closed 1 year ago

medir commented 1 year ago

Describe your question/ We are trying to sync users using "Federation & social logins" against an Active Directory (Windows Server 2016) . We are running Authentik with the default docker compose (1 redis, 1pg, 1 server and 1 worker) and we want to synchronize 9k users but the process is too slow, approximately 1.2 users / second.

We have tried to add more workers (12) but we have not noticed any speed improvement. Is there any kind of configuration that could improve the synchronization speed?

Maybe the only solution is the one proposed in this enhancement.

Relevant infos

Version and Deployment (please complete the following information):

BeryJu commented 1 year ago

The main reason why the sync speed doesn't scale with more workers is because the sync happens in a single task (well, there's a task for user sync, group sync and membership sync)