When LDAP is configured to have a large number of groups (1000+, beyond the optimal suggested number) syncing on start up can take a loooong time.
To fix this you can set search filters, but if the sync has already started there isn't a way to stop it.
Follow the steps documented here: How To Delay The Directory Sync On Startup In Confluence
- Go to Confluence Admin > User Directories and find your LDAP directory
- Click 'Edit'
- Under 'Schema Settings' enter dummy values for 'Additional User DN' and 'Additional Group DN', for example "ou=dummy"
- Click 'Test Settings' and then 'Save'
- Restart Confluence
When Confluence starts, it will attempt to sync using the new dummy values and fail. You can then either set the the search filters, change the LDAP configuration or remove the directory altogether.