core icon indicating copy to clipboard operation
core copied to clipboard

Slow PROPFIND on Shared folders

Open dphi opened this issue 13 years ago • 26 comments

Browser: curl, owncloud-sync Server OS: Debian Wheezy, mod_php with apc, mysql ownCloud: 5.0.3

PROPFIND takes too long for shared folders.

A very problematic folder with 88 files in total and 1020kbyte in total file size has the following characteristics:

  • ~0.5s for the user sharing the folder, and
  • ~70s for the user with which the folder was shared.

The problematic folders are deep in the directory structure, e.g. in the 6th sub-directory within the shared folder. The shared folder in numbers: 5.8G in total size, 2600 folders, and 26000 files.

The time is spent on the client side within the PHP code. MySQL and Apache CPU usage is negligible.

Execution times of PHP scripts greater than 30 seconds do only continue with adjusted PHP settings. The owncloud sync client needs an adjusted time out setting to wait that long as well. (This is how I originally noticed the problem: Errno 10007 messages in the owncloud sync client.)

See http://git.csync.org/users/freitag/csync.git/commit/?h=dav_0.70.5&id=2a5c403d63d48ece1571d8021b3ef576a2f16cd5 . @dragotin @danimo were informed about the time out issue before.

The difference to #2719 is part 5, the lock up. Two requests are being handled as expected in my case.

dphi avatar Apr 10 '13 11:04 dphi

@MTGap @icewind1991 @blizzz

BernhardPosselt avatar Apr 10 '13 12:04 BernhardPosselt

5.0.4 and 5.0.5 did not fix the issue.

dphi avatar Apr 20 '13 08:04 dphi

It's because the permission check is done for each individual file. @icewind1991 I think we need to implement the permission cache better. Do it in one query with the file cache?

MTGap avatar May 06 '13 15:05 MTGap

Hi! I´m new and I am also facing the PROPFIND issue. The guys from forum.owncloud.org sent me to github and this is the topic I opened there: http://forum.owncloud.org/viewtopic.php?f=14&t=11381

If I can help or provide you with more information, please let me know! Thanks very much in advance!

kkris9 avatar May 22 '13 09:05 kkris9

In reference to the issue I just opened (and was closed as dupe of this) - it seems also that the web interface is now facing similar / related slowness. For PROPFIND it's useful to support recursively looking up all the paths / files and getting one giant list, vs lots of small calls, but for the web browser interface this is rather unresponsive - it shouldn't nest so deep (or at all).

jonathanvaughn avatar May 23 '13 01:05 jonathanvaughn

In context of the slow upload of many files in #331 I did some upload-tests with the sync client today with oC 5.0.5 and 5.0.6. As @danimo mentioned above, they are obviously results of this issue. Here are my results:

Uploading one file of 100 MB (oC 5.0.5): 4622 ms (0,077 minutes) Uploading hundred files of 1 MB (oC 5.0.5): 1777348 ms (29,622 minutes) Uploading hundred files of 1 MB (oC 5.0.6): 735211 ms (12,253 minutes) Uploading hundred files of 1 KB (oC 5.0.5): 753323 ms (12,555 minutes)

As you can see, there is a great difference between one file of 100 MB and hundred files of 1 MB. The difference became smaller with 5.0.6 but it in my case, oC is unfortunately almost unusable with this performance.

Details about my setup and the logfiles can be found at my original post at #331.

wunderlich avatar May 27 '13 13:05 wunderlich

@wunderlich did you upload to shared folders? And did you measure different results on shared and "normal" folders?

dphi avatar May 27 '13 14:05 dphi

@dphi No, I did not. At the moment, I use oC as a single-user. I only created the a folder 'test' at my user-accounts root-directory at oC.

wunderlich avatar May 27 '13 14:05 wunderlich

@wunderlich Then, this problem might not be related to yours. My testcase using the PROPFIND request only triggers the issue discussed here on shared folders.

dphi avatar May 27 '13 14:05 dphi

@dphi Ah, sorry. I just followed @danimo 's suggestion and his explanation sounded good to me.

wunderlich avatar May 27 '13 16:05 wunderlich

@MTGap How would you suggest to test the change? By applying the patch of your commit to 5.0.6? Or are additional patches needed?

dphi avatar May 31 '13 09:05 dphi

How can I apply the update as soon as possible? I also would test a kind of beta version. Was the change made in the sync client or the server code?

kkris9 avatar Jun 05 '13 10:06 kkris9

Is this fix in the just released 5.0.7 ?

jonathanvaughn avatar Jun 06 '13 18:06 jonathanvaughn

@jonathanvaughn I updated to 5.0.7 today and what I see is (based on two users in the same OC group are syncing exactly the same folders shared by the admin account (20GB)), that one of my OC users is getting the data from the OC Server perfectly with good speed, the other one is "PROPFIND"-ing himself "to death", although he already downloaded about 2GB. I will just leave the PCs on over night and check tomorrow.

kkris9 avatar Jun 06 '13 22:06 kkris9

jfyi: the second client did not do anything during the night, except PROPFIND. I don´t get it.

I now deleted the so far downloaded 2GB from the client and started the synchronization from the beginning again. Until now its PROPFIND what I see in the server´s apache-access log. The second client does the PROPFIND now, too, but almost downloaded everything.

kkris9 avatar Jun 07 '13 09:06 kkris9

The fix is not in oc 5.0.7 .

dphi avatar Jun 07 '13 10:06 dphi

good, thanks for the info :) :+1:

kkris9 avatar Jun 07 '13 10:06 kkris9

I hope that this is not annoying, instead helpful: The client stopped synchronizing after the same size of downloaded data. Excatly like yesterday at 2.91 GB. The other client sends a lot of PROPFIND requests, too, but downloading data from time to time.

Can I give you some logfiles or other information to help you solve this?

kkris9 avatar Jun 07 '13 15:06 kkris9

We are also facing this issue and it is rather embarassing. Can we use the code from the fix and apply it as a patch on our test instance? We will report our tests results here.

gwelr avatar Jun 14 '13 10:06 gwelr

Any timeframe for when this will make it into a release? Or, barring that, is there a safe patch we can apply to 5.0.7 to get this fix? (I'm not sure what else may have changed between 5.0.7 and this)

jonathanvaughn avatar Jun 25 '13 20:06 jonathanvaughn