-
Notifications
You must be signed in to change notification settings - Fork 19
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
crazy DB load from Dashboard widget #1538
Comments
Thanks for reporting this and especially for collecting and providing all the relevant information already. The query is located in collectives/lib/Service/RecentPagesService.php Lines 51 to 72 in df190af
I can confirm that in some cases it seems the mtime index is used which can be rather problematic:
|
as @max-nextcloud brought up, filtering for the storage id would help quite a bit: (f.storage = 2) AND ...
Current query
|
May I ask why is the query executed even if the widget is not displayed? Is this a NC bug? Does it load all widgets when opening the Dashboard, regardless of their display status? |
I think the server is still collecting all widget data upfront and pass it to the frontend at page load time to have it available if a user adds the widget. However sounds like something to optimize further, could you file an issue about that in the server repo? |
Seems to already be reported. |
This would only require limiting the query to the right storage here: |
Describe the bug
After upgrading NC to v30, I noticed that the system load on the DB machine skyrocketed, and the DBMS keeps crashing. I started monitoring the running queries on it, and what I see is an ever inscreasing number of the query below, which keeps multiplying until either the server runs out of memory and restarts, or - if I’m lucky - docker recycles the DBMS container.
Turns out, the Collectives app causes it, only when the Dashboard is open in my browser. Disabling the app “fixes” the problem.
The weird thing is that it happens even if only a single tab whatsoever has the Dashboard open, and despite the Collectives widget is not even selected/displayed. I don’t know how to disable the widget even more, without disabling the app altogether.
In any case, even if the Dashboard is open and with the widget enabled, it shouldn’t execute a query which runs for several minutes, and especially not starting it over and over again in parallel, until it brings the DBMS down.
Let me add here that I suspect the query does a full table scan on the ~800,000 row
oc_filecache
, because I don't think it can use the only (maybe) related index:To Reproduce
Steps to reproduce the behavior:
oc_filecache
Expected behavior
Not overloading the DBMS.
Screenshots
Server details:
Client details:
The text was updated successfully, but these errors were encountered: