Skip to content

Stat cache for DAV storage, improves s2s performance a little bit - #14120

Merged
MorrisJobke merged 1 commit into
masterfrom
dav-statcache
Apr 8, 2015
Merged

MorrisJobke merged 1 commit into
masterfrom
dav-statcache

Conversation

@PVince81

Copy link
Copy Markdown
Contributor

@icewind1991 @karlitschek @DeepDiver1975 @schiesbn

I ran the pyocclient test suite:

  1. Against s2s folder on localhost with this PR: 539.394s
  2. Against s2s folder on localhost without this PR: 964.598s
  3. Against regular folder: 71.972s

@PVince81

Copy link
Copy Markdown
Contributor Author

Partial fix for #13882

@PVince81

Copy link
Copy Markdown
Contributor Author

Regression testing (for the stuff that might not be covered)

  • manual test with s2s shares, web UI
  • test with regular DAV/ownCloud ext storage
  • regression test sync client + s2s share

@karlitschek

Copy link
Copy Markdown
Contributor

nice idea. 👍 Not tested yet.

@PVince81

Copy link
Copy Markdown
Contributor Author

Well ideally we need this for every ext storage, see #7910

@PVince81

Copy link
Copy Markdown
Contributor Author

This improves performance from about 1.78 times, see #14120 (comment)

Comment thread lib/private/cache/arraycache.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accident or fact?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fact. Borrowed from #7897 which also needs review since many releases...

@nickvergessen nickvergessen added this to the 8.1-next milestone Feb 24, 2015
Comment thread lib/private/app.php.rej Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accident?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah...

@PVince81

PVince81 commented Mar 4, 2015

Copy link
Copy Markdown
Contributor Author
  • BUG: cache path mismatch due to leading slashes

@PVince81

PVince81 commented Mar 4, 2015

Copy link
Copy Markdown
Contributor Author

Additional fails to look into:


1) Test\Files\Storage\OwnCloud::testStat
Failed asserting that 100 matches expected 1425463750.

/srv/www/htdocs/owncloud/tests/lib/files/storage/storage.php:301

2) Test\Files\Storage\OwnCloud::testRecursiveRmdir
Failed asserting that true is false.

/srv/www/htdocs/owncloud/tests/lib/files/storage/storage.php:359

3) Test\Files\Storage\OwnCloud::testRecursiveUnlink
Failed asserting that true is false.

/srv/www/htdocs/owncloud/tests/lib/files/storage/storage.php:372

4) Test\Files\Storage\OwnCloud::testRenameDirectory
Failed asserting that true is false.

/srv/www/htdocs/owncloud/tests/lib/files/storage/storage.php:438

@PVince81

PVince81 commented Mar 4, 2015

Copy link
Copy Markdown
Contributor Author
  • recursively remove cached entries on delete...

@PVince81

PVince81 commented Mar 4, 2015

Copy link
Copy Markdown
Contributor Author

@icewind1991 sometimes I wonder if we shouldn't just wire up storage file operation directly to the DB cache instead of redoing additional calls or introducing additional stat cache layers...

@PVince81

PVince81 commented Mar 4, 2015

Copy link
Copy Markdown
Contributor Author

For example here: https://github.com/owncloud/core/blob/master/lib/private/files/storage/dav.php#L507
That is_dir call could be done against the view / DB cache instead of connecting to the remote. It is just unfortunate that we're at storage level here, not view level.

@PVince81

PVince81 commented Mar 4, 2015

Copy link
Copy Markdown
Contributor Author
  • test: storage not available / storage expired cases

@PVince81

PVince81 commented Mar 4, 2015

Copy link
Copy Markdown
Contributor Author
  • test: DAV unit tests

@icewind1991

Copy link
Copy Markdown
Contributor

@icewind1991 sometimes I wonder if we shouldn't just wire up storage file operation directly to the DB cache instead of redoing additional calls or introducing additional stat cache layers...

imo that should not be done in the storage layer, ideally apps use the Node/FileInfo objects to get stuff directly from cache but we could do it in the View to for some operations.

@icewind1991

Copy link
Copy Markdown
Contributor

Also note that flysystem has integrated caching support so for every backend using that (webdav is an option) we get stat caching for free

@PVince81

PVince81 commented Mar 4, 2015

Copy link
Copy Markdown
Contributor Author

I'm not talking about apps. Sometimes the storage itself needs to do checks like is_dir, etc. But that won't be cached by default. We don't want storage classes to use the node API (going up through the layers)

@MorrisJobke

Copy link
Copy Markdown
Contributor

rebase needed.

What is the state of this?

@PVince81

Copy link
Copy Markdown
Contributor Author

It's should work but needs testing.

@PVince81

Copy link
Copy Markdown
Contributor Author
  • unit test
  • pyocclient test in OC ext storage
  • pyocclient test in s2s
  • sync client + OC ext storage
  • sync client + s2s folder

BUG: overwrite a file locally with OC ext storage + sync client, file is marked as conflicted! (s2s is fine though) Raised as #15125 (unrelated to this PR)

@PVince81

Copy link
Copy Markdown
Contributor Author

Requires #15126 to be able to properly regression test unavailable storages

@PVince81

Copy link
Copy Markdown
Contributor Author

#15126 was merged, rebasing.

@MorrisJobke

Copy link
Copy Markdown
Contributor

The stat cache stored known states of files/folders to avoid requerying
the DAV server multiple times.
@PVince81

Copy link
Copy Markdown
Contributor Author

Now using the existing ArrayCache

@scrutinizer-notifier

Copy link
Copy Markdown

The inspection completed: No issues found

@ghost

ghost commented Apr 7, 2015

Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/11280/
🚀 Test PASSed.🚀
chuck

@MorrisJobke

Copy link
Copy Markdown
Contributor

works 👍

@PVince81

PVince81 commented Apr 8, 2015

Copy link
Copy Markdown
Contributor Author

Second reviewer @icewind1991 @nickvergessen ?

@karlitschek

Copy link
Copy Markdown
Contributor

👍

MorrisJobke added a commit that referenced this pull request Apr 8, 2015
Stat cache for DAV storage, improves s2s performance a little bit
@MorrisJobke
MorrisJobke merged commit 4e60b81 into master Apr 8, 2015
@MorrisJobke
MorrisJobke deleted the dav-statcache branch April 8, 2015 19:09
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants