Timeout showing users (100 users)

I have version: Nextcloud Hub 10 (31.0.4)
I have about 100 users.
I have about 10-15 groups each with different number of users.
The problem is that if i click “all users” i get a timeout error after about 30-60 seconds.

If i try to click on the smaller groups, it shows the users, slowly, the i gradually click on each group (with larger number of users), i eventually can click “all users” and see all of them.
It seems that it makes some kind of cache when showing the users.

So does anyone else have this kind of problem ?
Where could i check to see what is happening that is causing this timeout when trying to see the users ?!

EDIT:
I forgot to add details about the instance.

Config:
{
“system”: {
“debug”: false,
“overwriteprotocol”: “https”,
“instanceid”: “REMOVED SENSITIVE VALUE”,
“passwordsalt”: “REMOVED SENSITIVE VALUE”,
“secret”: “REMOVED SENSITIVE VALUE”,
“trusted_domains”: [
“cloud.sni.ro”
],
“datadirectory”: “REMOVED SENSITIVE VALUE”,
“dbtype”: “mysql”,
“version”: “31.0.4.1”,
“overwrite.cli.url”: “https://host/nextcloud”,
“dbname”: “REMOVED SENSITIVE VALUE”,
“dbhost”: “REMOVED SENSITIVE VALUE”,
“dbport”: “”,
“dbtableprefix”: “oc_”,
“mysql.utf8mb4”: true,
“dbuser”: “REMOVED SENSITIVE VALUE”,
“dbpassword”: “REMOVED SENSITIVE VALUE”,
“installed”: true,
“mail_from_address”: “REMOVED SENSITIVE VALUE”,
“mail_smtpmode”: “smtp”,
“mail_sendmailmode”: “smtp”,
“mail_domain”: “REMOVED SENSITIVE VALUE”,
“mail_smtpauthtype”: “LOGIN”,
“mail_smtpauth”: 1,
“mail_smtphost”: “REMOVED SENSITIVE VALUE”,
“mail_smtpport”: “587”,
“mail_smtpname”: “REMOVED SENSITIVE VALUE”,
“mail_smtppassword”: “REMOVED SENSITIVE VALUE”,
“mail_smtpsecure”: “tls”,
“memcache.local”: “\OC\Memcache\APCu”,
“default_phone_region”: “40”,
“has_rebuilt_cache”: true,
“maintenance”: false,
“enable_previews”: true,
“enabledPreviewProviders”: [
“OC\Preview\Image”,
“OC\Preview\Movie”,
“OC\Preview\TXT”
],
“theme”: “”,
“log_type”: “file”,
“logfile”: “/mnt/nextcloud_data/nextcloud.log”,
“loglevel”: 0,
“logdateformat”: “F d, Y H:i:s”,
“memcache.distributed”: “\OC\Memcache\Redis”,
“memcache.locking”: “\OC\Memcache\Redis”,
“redis”: {
“host”: “REMOVED SENSITIVE VALUE”,
“port”: 6379
},
“app_install_overwrite”: [
“drawio”
],
“maintenance_window_start”: 1
}
}

App list:
Enabled:

  • activity: 4.0.0
  • app_api: 5.0.2
  • bruteforcesettings: 4.0.0
  • calendar: 5.2.2
  • circles: 31.0.0
  • cloud_federation_api: 1.14.0
  • contacts: 7.0.6
  • dashboard: 7.11.0
  • dav: 1.33.0
  • deck: 1.15.0
  • event_update_notification: 2.6.1
  • federatedfilesharing: 1.21.0
  • files: 2.3.1
  • files_downloadlimit: 4.0.0
  • files_pdfviewer: 4.0.0
  • files_sharing: 1.23.1
  • files_trashbin: 1.21.0
  • files_versions: 1.24.0
  • groupfolders: 19.0.4
  • lookup_server_connector: 1.19.0
  • notes: 4.12.0
  • notifications: 4.0.0
  • oauth2: 1.19.1
  • password_policy: 3.0.0
  • photos: 4.0.0-dev.1
  • privacy: 3.0.0
  • profile: 1.0.0
  • provisioning_api: 1.21.0
  • richdocuments: 8.6.4
  • serverinfo: 3.0.0
  • settings: 1.14.0
  • suspicious_login: 9.0.1
  • systemtags: 1.21.1
  • tables: 0.9.1
  • tasks: 0.16.1
  • text: 5.0.0
  • theming: 2.6.1
  • twofactor_backupcodes: 1.20.0
  • updatenotification: 1.21.0
  • viewer: 4.0.0
  • webhook_listeners: 1.2.0
  • whiteboard: 1.0.5
  • workflowengine: 2.13.0
    Disabled:
  • admin_audit: 1.21.0
  • afterlogic: 2.0.12 (installed 2.0.12)
  • appointments: 2.3.6 (installed 2.3.6)
  • comments: 1.21.0 (installed 1.15.0)
  • contactsinteraction: 1.12.0 (installed 1.9.0)
  • encryption: 2.19.0
  • federation: 1.21.0 (installed 1.18.0)
  • files_external: 1.23.0
  • files_reminders: 1.4.0 (installed 1.1.0)
  • files_rightclick: 0.15.1 (installed 1.6.0)
  • firstrunwizard: 4.0.0 (installed 2.14.0)
  • forms: 5.0.3 (installed 5.0.3)
  • integration_openai: 3.5.0 (installed 3.5.0)
  • logreader: 4.0.0 (installed 2.12.0)
  • mail: 4.2.6 (installed 4.2.6)
  • nextcloud_announcements: 3.0.0 (installed 1.16.0)
  • picker: 1.0.12 (installed 1.0.12)
  • recommendations: 4.0.0 (installed 1.4.0)
  • related_resources: 2.0.0 (installed 1.2.0)
  • sharebymail: 1.21.0 (installed 1.15.0)
  • sharelisting: 1.2.0 (installed 1.2.0)
  • spreed: 21.0.3 (installed 21.0.3)
  • support: 3.0.0 (installed 1.8.0)
  • survey_client: 3.0.0 (installed 1.13.0)
  • twofactor_nextcloud_notification: 5.0.0
  • twofactor_totp: 13.0.0-dev.0
  • user_ldap: 1.22.0
  • user_status: 1.11.0 (installed 1.7.0)
  • weather_status: 1.11.0 (installed 1.5.0)

Do you get the timeout from php, or the database behind? Some logs and/or activity of services during you do this request might be helpful.

Did you use other external authentication backend, perhaps in the past, that still might have some entries in tables that might create some conflicts?

Within your apps enabled list I cannot see the app logreader where you maybe can see some helpful errors

I dont use an external authentication backend.
So this is the request: nextcloud/ocs/v2.php/cloud/users/details?offset=0&limit=25&search=

This is the response:

504 Gateway Time-out

The server didn't respond in time.

This is from the console:

get @ api.js:51
getUsers @ users.js:395
loadUsers @ UserList.vue:295
created @ UserList.vue:244
Promise.then
18539 @ main-apps-users-management.ts:27
o @ bootstrap:19
(anonymous) @ startup:4
(anonymous) @ chunk loaded:25
(anonymous) @ startup:5
(anonymous) @ settings-vue-setting…t.js?v=05db1ddf-4:1

Im not sure where to check to see what its actually waiting for.
The database is on the same machine, so there shouldn’t be any problems there.
If i check mysql and run SHOW PROCESSLIST; there is no query that is waiting or something.

I enabled Log reader.
What should i be looking for.

reproduce the timeouts and take a look at the logreader app if there are new logs inside