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
NC 13.0.1: PROPFIND takes long on chdir, when the dir contains lots of files (listing the same No. of directories is fast) #8977
Comments
I wondered why 47 queries only take 280ms where 413 queries take 8 seconds. The 47 queries should at least take a little bit longer. The reason is, that a query in the form of: The query takes about the same amount of time even when the last condition is omitted: Shortening the query even more to: Returns a set of almost 25000 entries... There seems to be an index on userid on the table. Since there is pretty much only one user in this table with close to 25000 entries, the index might not have a great effect (please correct me if I'm wrong). I can see how it can take 8 seconds to go through all this 366 times... In total these are 9 million lines. |
I reverted back to 12.0.6 (restored DB, cleared appdata_xxxxxxxxxxxx, and copied 12.0.6 files into place). @icewind1991 @rullzer Do you know what changed in regards of listing files between 12.0.6 and 13.0.1? |
Ah yes. I think I know. |
I'll prepare a pr once at my laptop |
fixes #8977 Else for all files in a folder we would launch off more queries. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@rullzer You added this patch to milestone 14. Could this patch by any chance also go into 13.0.2? |
@Rayn0r we'll evaluate that once it is merged. Of course if this is mission critical to you I would recommend you contact sales at https://nextcloud.com/enterprise/ (I'm just guessing you have a fairly large setup by the hardware specs you are have 😉 ) |
fixes #8977 Else for all files in a folder we would launch off more queries. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Steps to reproduce
Expected behaviour
Files should be display within milliseconds after changing into a folder
Actual behaviour
It takes over 8 seconds for the content to appear.
During this time the MySQL instance is at 80-100% CPU usage.
After the files are finally displayed, thumbnails are loaded instantly.
To dig a bit deeper I enabled:
general_log_file = /var/log/mysql/mysql.log
general_log = 1
in my mysql.cnf.
While PROPFIND is running, Nextcloud issues around 413 MySQL commands.
366 Queries look like this:
SELECT * FROM
oc_properties
WHEREuserid
= 'username' ANDpropertypath
= '/list-test/1/IMG_XXXXXXXX_XXXXXX.jpg' ANDpropertyname
in ('{http://nextcloud.org/ns}is-encrypted')There is one query for each file inside the list-test directory...
I also created a folder and created 365 empty folders inside it. Listing this folder only takes around 280ms.
Listing those 365 directories only issues 47 queries and none of the above...
47+366 is 413... Which is the exact number of queries for the directory containing files!
The URL inside the query in question is "http://nextcloud.org/ns" Trying to resolve nextcloud.org results in an error. There does not seem to be a DNS A-Record for this domain.
So, what is being queried in those 366 queries?
What's even more interesting: What purpose do those queries have?
Server configuration
Operating system: Ubuntu 16.04
Web server: Apache 2.4.18
Database: MySQL 5.7.21
PHP version: 7.0.28
Nextcloud version: 13.0.1.1
Hardware: Intel Xeon E3-1245 v6, 16GB RAM
Updated from an older Nextcloud/ownCloud or fresh install: Upgrade from OC9 manually. Then used Updater App to go from 9 to 10 and so forth.
After upgrading to 13.0.1 I also ran this while in maintenance mode:
sudo -u www-data php occ db:add-missing-indice
sudo -u www-data php occ db:convert-filecache-bigint
Where did you install Nextcloud from: Upgrade via Updater from 12.0.06
Signing status:
Signing status
List of activated apps:
App list
Nextcloud configuration:
Config report
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: no
Client configuration
Browser: FF 58.0.2
Operating system: Windows 7
Logs
Web server error log
Web server error log
Nextcloud log (data/nextcloud.log)
Nextcloud log
Browser log
Browser log
The text was updated successfully, but these errors were encountered: