-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Very long running query eats almost all CPU #29377
Comments
This must help (maybe you can give it a try?): #28541 |
Thank yu, just adding
to the database. Now let's try if it helps ;-) Thank you. |
Ok, it did speed up the queries but the problem remains since they are still running much too long. |
possiby same problem: #29392 |
Let's move this to #23835 and centralize discussions there. |
Problem
We are currently running NC 21.0.3.1 on four Apache-servers with a central MariaDB 10.4.17.
Every few days the CPU load on the database server is extremely high and we find a large number of processes from the same Apache node executing the same statement. The DB Server is normally running with less than 30% CPU load, uses more than 90% when those queries are active.
A test on the command line showed that those statements have a runtime of about 2 minutes and deliver an empty result set.
It seems that users call a function that takes too long for them and then call the same function again, e.g. via reload and start a new query while the old queries are still running.
Output of show processlist;
Sample SQL:
At first glance, usable indexes on the columns "path" and "name" are missing. The index fs_parent_name_hash contains the column "name", but also "parent" as the first column, which makes it unusable for queries like this, only on "name" without "parent".
In addition, the LIKE query with masking of the first bytes can hardly be optimised via a normal index. A reformulation with a FULL TEXT INDEX and the appropriate MATCH() ... AGAINST query would probably be faster.
occ db:add-missig-indexes has been run and doesn't miss any index.
Expected behaviour
Queries in an online system should not take more than some parts of a second.
Actual behaviour
The database server is at its load limit and at least one user is frustrated by the poor performance of Nextcloud.
Server configuration
Operating system:
openSUSE 15.2
Web server:
Apache
Database:
MariaDB 10.4.17
PHP version:
7.4.6
Nextcloud version:
NC 21.0.3.1
Updated from an older Nextcloud/ownCloud or fresh install:
Updated from NC 20.x
The text was updated successfully, but these errors were encountered: