nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.81k stars 4k forks source link

LDAP search very slow when sharing #24505

Closed sunflowerbofh closed 3 years ago

sunflowerbofh commented 3 years ago

Steps to reproduce:

  1. Click on share symbol of a file
  2. type a name into search field
  3. wait...

Expected behaviour The search should be halfway fast like ldapsearch ob the server. The result should be reliable. The search should not start immediately as the user starts typing, but with a grace time of e.g. 0.5s. Otherwise a search for 'schmid' would result in single searches for s, sc, sch, schm a.s.o.

Actual behaviour The LDAP query is very slow (up to one minute). Sometimes there is no result (only if I resubmit the search string) or only the result of last query. When pasting the whole search string in one piece instead of typing the sharing LDAP search goes faster. Already tried:

Server configuration Operating system: Debian buster Web server: apache2.4 Database: postgresql13 PHP version: 7.3 Nextcloud version: 20.0.2 Updated from an older Nextcloud/ownCloud or fresh install: Update from 19 -> 20.0.1 => 20.0.2 Where did you install Nextcloud from: download.nextcloud.com/

Signing status: Results

List of activated apps: Enabled:

Nextcloud configuration: { "system": { "passwordsalt": "REMOVED SENSITIVE VALUE", "secret": "REMOVED SENSITIVE VALUE", "trusteddomains": [ "localhost", "node1.web.nextcloud-test.xyz.xxxxx", "nextcloud-test.xyz.xxxxxx" ], "datadirectory": "REMOVED SENSITIVE VALUE", "dbtype": "pgsql", "version": "20.0.2.2", "overwrite.cli.url": "https:\/\/nextcloud-test.xyz.xxxxxx", "overwrite.host": "nextcloud-test.xyz.xxxxxxx", "dbname": "REMOVED SENSITIVE VALUE", "dbhost": "REMOVED SENSITIVE VALUE", "dbport": "", "dbtableprefix": "oc", "dbuser": "REMOVED SENSITIVE VALUE", "dbpassword": "REMOVED SENSITIVE VALUE", "installed": true, "instanceid": "REMOVED SENSITIVE VALUE", "trusted_proxies": "REMOVED SENSITIVE VALUE", "overwriteprotocol": "https", "memcache.local": "\OC\Memcache\Memcached", "updater.release.channel": "stable", "trashbin_retention_obligation": "92", "logtimezone": "Europe\/Zurich", "log_rotate_size": "943718400", "mail_from_address": "REMOVED SENSITIVE VALUE", "mail_domain": "REMOVED SENSITIVE VALUE", "mail_smtphost": "REMOVED SENSITIVE VALUE", "skeletondirectory": "\/srv\/node1.web.nextcloud-test.xyz.xxxxxx\/nextcloud\/skeleton-bfh", "theme": "", "lost_password_link": "disabled", "loglevel": "0", "maintenance": false, "mail_smtpmode": "smtp", "mail_sendmailmode": "smtp", "logfile": "\/srv\/node1.web.nextcloud-test.xyz.xxxxxx\/nextcloud-data\/nextcloud-test.log" } } Are you using external storage, if yes which one: ceph, mounted as nfs share

Are you using encryption: no

Are you using an external user-backend, if yes which one: LDAP

LDAP configuration: | Configuration | s01 | hasMemberOfFilterSupport | 1 | homeFolderNamingRule | | lastJpegPhotoLookup | 0 | ldapAgentName | | ldapAgentPassword | *** | ldapAttributesForGroupSearch |· | ldapAttributesForUserSearch | | ldapBackupHost | ldaps://node2.ldap.xyz.xxxxxxx | ldapBackupPort | 636 | ldapBase | dc=xyz | ldapBaseGroups | ou=Security,ou=Groups,dc=xyz | ldapBaseUsers | ou=Accounts,dc=xyz | ldapCacheTTL | 600 | ldapConfigurationActive | 1 | ldapDefaultPPolicyDN | | ldapDynamicGroupMemberURL | | ldapEmailAttribute | mail | ldapExperiencedAdmin | 0 | ldapExpertUUIDGroupAttr | bfhOid | ldapExpertUUIDUserAttr | bfhOid | ldapExpertUsernameAttr | cn | ldapExtStorageHomeAttribute | | ldapGidNumber | gidNumber
| ldapGroupDisplayName | cn | ldapGroupFilter | (&(|(objectclass=bfhGroup))) | ldapGroupFilterGroups |
| ldapGroupFilterMode | 0
| ldapGroupFilterObjectclass | bfhGroup
| ldapGroupMemberAssocAttr | member | ldapHost | ldaps://node2.ldap.xyz.xxxxxxx | ldapIgnoreNamingRules |
| ldapLoginFilter | (&(objectClass=bfhAccount)(|(&(ou:dn:=Staff)(ou:dn:=Accounts))(&(ou:dn:=Students)(ou:dn:=Accounts))(memberOf=cn=idm.lfe.nextcloud.users-manual,ou=security,ou=groups,dc=xyz))(uid=%uid)) | | ldapLoginFilterAttributes | | ldapLoginFilterEmail | 0
| ldapLoginFilterMode | 1
| ldapLoginFilterUsername | 1
| ldapMatchingRuleInChainState | unavailable
| ldapNestedGroups | 1 | ldapOverrideMainServer |· ldapPagingSize | 500 | ldapPort | 636 | ldapQuotaAttribute |· | ldapQuotaDefault | | ldapTLS | 0 | ldapUserAvatarRule | default | ldapUserDisplayName | displayname | ldapUserDisplayName2 | cn | ldapUserFilter | (&(objectClass=bfhAccount)(|(&(ou:dn:=Staff)(ou:dn:=Accounts))(&(ou:dn:=Students)(ou:dn:=Accounts))(memberOf=cn=idm.lfe.nextcloud.users-manual,ou=security,ou=groups,dc=bfh))(uid=%uid)) | ldapUserFilterGroups | | ldapUserFilterMode | 1 | ldapUserFilterObjectclass | | ldapUuidGroupAttribute | auto | ldapUuidUserAttribute | auto | turnOffCertCheck | 0 | turnOnPasswordChange | 0

Client configuration Browser: Firefox 83.0 Operating system: Debian Buster

Logs Web server error log: none

Nextcloud log (data/nextcloud.log) Debug files_sharing /appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class 2020-12-02T14:37:11+01:00 instead.

Debug files_external /appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class 2020-12-02T14:37:11+01:00 instead.

Debug groupfolders /appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class 2020-12-02T14:37:11+01:00 instead.

Debug contacts /appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class 2020-12-02T14:37:11+01:00 instead.
(...)

Browser log jQuery is deprecated: The global jQuery is deprecated. It will be updated to v3.x in Nextcloud 21. In later versions of Nextcloud it might be removed completely. Please ship your own. XHRGEThttps://node1.web.nextcloud-test.xyz.xxxxxxx/ocs/v2.php/apps/user_status/api/v1/statuses/...

HerrWo commented 3 years ago

I've the same bug on nc 20.0.7

solracsf commented 3 years ago

I'm using LDAP with more than 8000 users. But with a very performant MySQL Server (24 cores, 192Gb RAM). I have no such problems. When i search for Adrien in a Share users list, i takes 2-3 seconds. If I search for a more generic name, like a simple a, it takes 3-5sec.

sunflowerbofh commented 3 years ago

Thanks for the feedback. We have a postgres (cluster) with 63 cores and 256 GB RAM. Since the update to version 21 I have the impression the search has become much faster. It takes up to 10 (mostly only 4-5) seconds for searching givenNames or surnames within 8000-9000 users. Let alone the substring search within groups does not work but that's probably another problem.

szaimen commented 3 years ago

Since acsfer cannot reproduce this, it sounds like a configuration problem to me. Also with that many users you should definitely have a Nextcloud subscription. Please continue the discussion in the forum https://help.nextcloud.com Thanks!

joc3j commented 1 year ago

@sunflowerbofh I can replicate this issue also on NC 24.0.7 Did you ever figure this one out?