-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Large number of DB queries during execution of a single API call #33289
Comments
Moving back to server. |
This should also all be improved since #31265 |
all right! sorry for that. Looked like a specific issue with the talk app to me |
I suspect that the
|
I went ahead and deleted all records from the This helped significantly. 😉 Now only two My preliminary conclusions are:
Any comments/suggestions? |
I have investigated the remaining The code tries to update the entries for the home mounts - i.e. the ones with Apparently it always tries to update the entry for the current user - so there is at least one I have tried to debug the I hope that information above would help someone else to find/fix the issue. |
I have been able to repeat the issue on a fresh Nextcloud installation (using Docker) in the following scenario.
After these steps I got the following contents in the
After deleting all records from the
Apparently potential gains from #30978 cannot be fully realized due to this issue. 😞 |
#33540 should fix pre-24 mountpoints not having their |
Thanks @icewind1991! I have checked #33540 in my dev environment - works as expected. 😄 |
As #33540 is now merged, I have moved the issue to Done in the Performance project and closing it now, |
@starypatyk I found this issue after searching and debugging a bunch because I...
I have 7474 rows in my
|
@icewind1991 is it safe to clear the oc_mounts table in NC 24 ? |
I updated to v24.0.7 I did not delete any rows in
Related thread: https://help.nextcloud.com/t/rogue-orphaned-mount-points-in-oc-mounts/118920/4 |
as far as I remember, the ones with "NULL" are supposed to auto-populate during access |
Right on, thanks.
I'm asking because I am still noticing some slow responses. I've also been watching the processlist in MariaDB and I see lots of DML against the The count of rows in my |
When diagnosing slow loading of chat messages in Nextcloud Talk application I have noticed that in my environment (NC 24.0.3, MySQL database), during execution of a single API call (retrieve chat messages), NC sends over 2000 DB queries.
I use the following call (same as the Nextcloud Talk Android app):
Most of the queries (over 2100 from about 2500) are:
There are about 1300 records in the x_mounts table. Majority of them (about 1100) have NULL in the mount_provider_class column.
This causes code in the registerMounts method of the UserMountCache class to ignore the existing cache entries and try to re-add them - see addToCache call.
However, the correct records are not added to the x_mounts table, since records with the same root_id and user_id already exist (the ones with NULL in the mount_provider_class column). And the same situation occurs on each subsequent API call.
As I understand the mount_provider_class column has been added recently. However, it seems that all the records that existed earlier in the x_mounts table, get NULL in the new column after upgrade. This in turn leads to the observed behaviour.
I am not sure how the issue should be fixed.
The text was updated successfully, but these errors were encountered: