Cron with LDAP slow, more than 20min to complete!

Hi,

We’re using a fresh install of Nextcloud 21 since 2 months. This week, we’ve enabled LDAP.

Before LDAP, cronjob would take no more than a few seconds to complete, now, after configuring LDAP, it takes an average of 20mn !!

I’ve set php occ ldap:set-config s02 ldapCacheTTL "3600" but it doesn’t help…

Any hints?

1 Like

Hey there, hope you are doing well…

How many users are we talking about?

Do you any groups integrated too? Are they nested?

Do you have any cache service like redis installed?

Hi,

500 users, Redis as cache (local, distributed, locking), no groups.

There are 2742 rows (3632 a few hours later) in the oc_jobs table, most of them either OCA\LookupServerConnector\BackgroundJobs\RetryJob or OCA\Settings\BackgroundJobs\VerifyUserData

select count(id) as jobs, class from oc_jobs group by class order by jobs desc;
+------+-----------------------------------------------------------------+
| jobs | class                                                           |
+------+-----------------------------------------------------------------+
| 2469 | OCA\LookupServerConnector\BackgroundJobs\RetryJob               |
| 1122 | OCA\Settings\BackgroundJobs\VerifyUserData                      |
|    2 | OCA\TwoFactorBackupCodes\BackgroundJob\RememberBackupCodesJob   |
|    1 | OCA\Talk\BackgroundJob\ResetAssignedSignalingServer             |
|    1 | OC\Preview\BackgroundCleanupJob                                 |
|    1 | OCA\NextcloudAnnouncements\Cron\Crawler                         |
|    1 | OC\Log\Rotate                                                   |
|    1 | OCA\Support\BackgroundJobs\CheckSubscription                    |
|    1 | OCA\Talk\BackgroundJob\CheckHostedSignalingServer               |
|    1 | OCA\Talk\BackgroundJob\CheckMatterbridges                       |
|    1 | OCA\Talk\BackgroundJob\ExpireSignalingMessage                   |
|    1 | OCA\Talk\BackgroundJob\RemoveEmptyRooms                         |
|    1 | OC\Authentication\Token\DefaultTokenCleanupJob                  |
|    1 | OCA\Text\Cron\Cleanup                                           |
|    1 | OCA\GroupFolders\BackgroundJob\ExpireGroupVersions              |
|    1 | OCA\UpdateNotification\Notification\BackgroundJob               |
|    1 | OCA\UserStatus\BackgroundJob\ClearOldStatusesBackgroundJob      |
|    1 | OCA\User_LDAP\Jobs\CleanUp                                      |
|    1 | OCA\User_LDAP\Jobs\Sync                                         |
|    1 | OCA\User_LDAP\Jobs\UpdateGroups                                 |
|    1 | OCA\WorkflowEngine\BackgroundJobs\Rotate                        |
|    1 | OCA\Files\BackgroundJob\CleanupDirectEditingTokens              |
|    1 | OCA\Activity\BackgroundJob\EmailNotification                    |
|    1 | OCA\Activity\BackgroundJob\ExpireActivities                     |
|    1 | OCA\Analytics\BackgroundJob\Daily                               |
|    1 | OCA\Analytics\BackgroundJob\Hourly                              |
|    1 | OCA\ContactsInteraction\BackgroundJob\CleanupJob                |
|    1 | OCA\DAV\BackgroundJob\CleanupDirectLinksJob                     |
|    1 | OCA\DAV\BackgroundJob\CleanupInvitationTokenJob                 |
|    1 | OCA\DAV\BackgroundJob\EventReminderJob                          |
|    1 | OCA\DAV\BackgroundJob\UpdateCalendarResourcesRoomsBackgroundJob |
|    1 | OCA\Federation\SyncJob                                          |
|    1 | OCA\Activity\BackgroundJob\DigestMail                           |
|    1 | OCA\Files\BackgroundJob\CleanupFileLocks                        |
|    1 | OCA\Files\BackgroundJob\DeleteOrphanedItems                     |
|    1 | OCA\Files\BackgroundJob\ScanFiles                               |
|    1 | OCA\Files_Sharing\BackgroundJob\FederatedSharesDiscoverJob      |
|    1 | OCA\Files_Sharing\DeleteOrphanedSharesJob                       |
|    1 | OCA\Files_Sharing\ExpireSharesJob                               |
|    1 | OCA\Files_Trashbin\BackgroundJob\ExpireTrash                    |
|    1 | OCA\Files_Versions\BackgroundJob\ExpireVersions                 |
|    1 | OCA\FirstRunWizard\Notification\BackgroundJob                   |
+------+-----------------------------------------------------------------+
42 rows in set (0.00 sec)

Found this issue and here : lookup_server_connector creates a lot of oc_jobs entries, high DB load during cron, and tries to sync even if disabled in options · Issue #13396 · nextcloud/server · GitHub

Tired : 'lookup_server' => '' in config.php

But it’s even worst…

image

1 Like