You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have a basic new NC11 or master instance, with local storage, mysql database
Create user{1,2}
Create n (5 in the following logs) folders in user1, share them with user2
Logon with user2, let the first time logon and database be populated, etc.
Log off user2
Start logging sql queries
Log on user2
Expected behaviour
Performance is relatively smooth, and already being up to date, oc_mounts is not updated
Actual behaviour
Login, and every page load is slow as **** (~10 sec on test instance with 5 folders shared)
Query log is full of
33661 Query UPDATE `oc_mounts` SET `storage_id` = '1', `mount_point` = '/user2/files/folder 5/', `mount_id` = NULL WHERE (`user_id` = 'user2') AND (`root_id` = 36)
33661 Query UPDATE `oc_mounts` SET `storage_id` = '1', `mount_point` = '/user2/files/folder 4/', `mount_id` = NULL WHERE (`user_id` = 'user2') AND (`root_id` = 35)
170212 18:00:18 33661 Query UPDATE `oc_mounts` SET `storage_id` = '1', `mount_point` = '/user2/files/folder 3/', `mount_id` = NULL WHERE (`user_id` = 'user2') AND (`root_id` = 34)
33661 Query UPDATE `oc_mounts` SET `storage_id` = '1', `mount_point` = '/user2/files/folder 2/', `mount_id` = NULL WHERE (`user_id` = 'user2') AND (`root_id` = 33)
33661 Query UPDATE `oc_mounts` SET `storage_id` = '1', `mount_point` = '/user2/files/folder 1/', `mount_id` = NULL WHERE (`user_id` = 'user2') AND (`root_id` = 31)
Full means, for 5 folders shared, when logging in then logging out, 95 updates (or 19/share), all updating to exactly the same values.
On my (relatively small) production system, each update (ie for each share) on oc_mounts takes 0.05 to 0.5s, with 10-30 shares/user...
Server configuration
Operating system: Centos 7
Web server: apache
Database: mysql
PHP version: 5.6
Nextcloud version: (see Nextcloud admin page) 11.0.1, master (as of f9d94ed)
Updated from an older Nextcloud/ownCloud or fresh install: Irrelevant (happens in local test setup as well as production instance)
Are you using external storage, if yes which one: local
Are you using encryption: no
Are you using an external user-backend, if yes which one: Irrelevant (happens in local test setup as well as LDAP instance)
Diagnostics and hack-fix
Digging into the code, it seems that the function findChangedMounts() (lib/private/Files/Config/UserMountCache.php#L138), which determines if the db needs to be updated always returns all the mounts as having changed, because this condition is always true:
Looking into details, it seems that $newMount->getStorageId() is a string while $cachedMount->getStorageId() is an int (or vice versa, I don't remember), at least for the test case presented at the top.
I would have done a pull request, but I'm unsure whether getStorageID should be an int or a string. In the meantime, changing the !== to != solves the issue, and everything is fast and smooth again and I now believe the "Nextcloud 11 is faster" claims.
Note that this might be related to people having issues in #2272 and #3134.
The text was updated successfully, but these errors were encountered:
Steps to reproduce
Expected behaviour
Performance is relatively smooth, and already being up to date, oc_mounts is not updated
Actual behaviour
Login, and every page load is slow as **** (~10 sec on test instance with 5 folders shared)
Query log is full of
Full means, for 5 folders shared, when logging in then logging out, 95 updates (or 19/share), all updating to exactly the same values.
On my (relatively small) production system, each update (ie for each share) on oc_mounts takes 0.05 to 0.5s, with 10-30 shares/user...
Server configuration
Operating system: Centos 7
Web server: apache
Database: mysql
PHP version: 5.6
Nextcloud version: (see Nextcloud admin page) 11.0.1, master (as of f9d94ed)
Updated from an older Nextcloud/ownCloud or fresh install: Irrelevant (happens in local test setup as well as production instance)
Are you using external storage, if yes which one: local
Are you using encryption: no
Are you using an external user-backend, if yes which one: Irrelevant (happens in local test setup as well as LDAP instance)
Diagnostics and hack-fix
Digging into the code, it seems that the function findChangedMounts() (lib/private/Files/Config/UserMountCache.php#L138), which determines if the db needs to be updated always returns all the mounts as having changed, because this condition is always true:
Looking into details, it seems that $newMount->getStorageId() is a string while $cachedMount->getStorageId() is an int (or vice versa, I don't remember), at least for the test case presented at the top.
I would have done a pull request, but I'm unsure whether getStorageID should be an int or a string. In the meantime, changing the !== to != solves the issue, and everything is fast and smooth again and I now believe the "Nextcloud 11 is faster" claims.
Note that this might be related to people having issues in #2272 and #3134.
The text was updated successfully, but these errors were encountered: