This repository has been archived by the owner on Feb 20, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 168
add note re using redis with file locking app #1182
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
=========================== | ||
Using the Files Locking App | ||
--------------------------- | ||
=========================== | ||
|
||
The Files Locking application enables ownCloud to lock files while reading or | ||
writing to and from backend storage. The purpose of the app is to avoid file | ||
|
@@ -16,4 +17,28 @@ underlying filesystem. | |
The Files Locking app has no configuration options; all you need to do is | ||
enable or disable it on your Apps page. | ||
|
||
.. figure:: ../images/files_locking_app.png | ||
.. figure:: ../images/files_locking_app.png | ||
|
||
We recommend using `Redis <http://redis.io/>`_ as your ownCloud memcache when | ||
you enable the Files Locking app. Memcached, the popular distributed memory | ||
caching system, is not suitable for a file locking app because it is designed | ||
to improve dynamic Web site performance. It is not designed to store locks, and | ||
data can disappear from the cache at any time. Redis is more than an object | ||
cache like Memcached; it is also a key-value store, so it guarantees that | ||
cached objects are available for as long as they are needed. Redis is available | ||
on most Linux distributions, and requires a simple configuration in your | ||
``config.php`` file, like this example:: | ||
|
||
'memcache.local' => '\OC\Memcache\redis', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it doesn't matter as long as the character following the |
||
'redis' => array( | ||
'host' => 'localhost', | ||
// can also be a unix domain socket: | ||
'/tmp/redis.sock' | ||
'port' => 6379, | ||
'timeout' => 0.0, | ||
// Optional, if undefined SELECT will not run and will use Redis | ||
// Server's default DB Index. | ||
'dbindex' => 0, | ||
), | ||
|
||
See ``config.sample.php`` to see configuration examples for all memcaches. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a major misunderstanding here.
The files_locking app is an old app that locked on filesystem level. That app does not need memcache at all.
Since 8.1, there is an experimental new file locking mechanism, totally unrelated to the files_locking app. That one can be enabled with "filelocking.enabled". That one requires redis.
In the future, if the new file locking mechanism works well, it will obsolete the old files_locking app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really? I thought that files_locking is for locking against concurrent processes to the ownCloud server on the server side (filesystem level).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are both about concurrency.
The difference is that files_locking use flock on filesystem level.
The new experimental locking uses a custom-lock implementation based on redis, and locks on View level. This makes it so that we can have "bigger" transactions during a lock.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no way to lock files in PHP reliably against other processes. 🙈 – PHP uses advisory based locking per default, see http://php.net/manual/en/function.flock.php and especially enjoy:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also the new experimental locking can lock parent folders. So for example you cannot rename a folder if someone exclusively locked a file inside it (while writing data into it)