You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Transactional File locking will not prevent multiple users from editing the same document, nor give notice that other users are working on the same document. Multiple users can open and edit a file at the same time and Transactional File locking does not prevent this. Rather, it prevents simultaneous file saving.
14
14
15
-
File locking is enabled by default, using the database locking backend. This places a significant load on your database. Using `memcache.locking` relieves the database load and improves performance. Admins of ownCloud servers with heavy workloads should install xref:configuration/server/caching_configuration.adoc[a memory cache] .
15
+
File locking is enabled by default, using the database locking backend. This places a significant load on your database. Using `memcache.locking` (OWNCLOUD_MEMCACHE_LOCKING) relieves the database load and improves performance. Admins of ownCloud servers with heavy workloads should install a
Copy file name to clipboardExpand all lines: modules/admin_manual/pages/configuration/server/caching_configuration.adoc
+61-4Lines changed: 61 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,10 +30,15 @@ The caching backends supported by ownCloud are:
30
30
This is a data cache only and does *not* cache any opcode. APCu is part of the Docker image.
31
31
* xref:redis[Redis] +
32
32
This is an in-memory data structure store (cache) for single and multi-server ownCloud installations, which provides file locking and can be set up in local or distributed environments. The required `php-redis` extension is already part of the Docker image. Redis is used of the Docker Compose deployment example. For details see the xref:installation/installing_with_docker.adoc#docker-compose[Installing With Docker] documentation.
33
+
* xref:memcached[Memcached] +
34
+
This is a distributed cache for multi-server ownCloud installations and has *very limited* file locking capabilities. +
35
+
Using Memcached for distributed locking is generally not recommended. Because its nodes do not communicate with each other and data isn't persistent, locks can be released unexpectedly or lost entirely if a server restarts. For reliable locking, Redis is the industry standard.
36
+
+
37
+
See the following page to learn more about the https://scalegrid.io/blog/redis-vs-memcached-2021-comparison/[Redis vs. Memcached – 2021 Comparison].
33
38
34
39
[NOTE]
35
40
====
36
-
You may use _both_ a local and a distributed cache. The recommended ownCloud caches are APCu and Redis. If you do not install and enable a local memory cache you will see a warning on your ownCloud admin page. If you enable only a distributed cache in your `config.php` (`memcache.distributed`) and not a local cache (`memcache.local`) you will still see the cache warning.
41
+
You may use _both_ a local and a distributed cache. The recommended ownCloud caches are APCu and Redis. If you do not install and enable a local memory cache you will see a warning on your ownCloud admin page. If you either enable Redis or Memcached, the distributedcache will be set automatically to the respective backend.
37
42
====
38
43
39
44
=== Cache Directory Location
@@ -97,13 +102,21 @@ NOTE: Out of the box, every Redis instance supports 16 databases so `<dbIndex>`
97
102
98
103
Please read more about the instructions for the {redis_select_url}[select] and {redis_flushdb_url}[flushdb] command.
99
104
105
+
=== Memcached
106
+
107
+
Memcached is a reliable old-timer for shared caching on distributed servers. It performs well with ownCloud with one exception: it is not suitable to use with Transactional File Locking. This is because it does not store locks, and data can disappear from the cache at any time. Given that, Redis is the best memory cache to use.
108
+
109
+
NOTE: The `memcached` PHP extension is already embedded in the Docker image and enabled.
110
+
100
111
== Configuring Memory Caching
101
112
102
113
Memory caches must be provided and explicitly configured in ownCloud by:
103
114
104
-
. When using Redis, it must be provided by either as described in the xref:installation/installing_with_docker.adoc#docker-compose[Docker Compose] example of the installation documentation or by other means.
115
+
. When using Redis or Memcached, it must be provided by either as described in the xref:installation/installing_with_docker.adoc#docker-compose[Docker Compose] example of the installation documentation or by other means.
105
116
. Configuring the caches used.
106
117
118
+
Note that the `OWNCLOUD_MEMCACHE_LOCKING` environment variable corresponds to the configuration setting `memcache.locking`. However, there is no counterpart for the setting `memcache.distributed`, as it is set automatically based on the caching type enabled.
CAUTION: ownCloud provides many configuration options for Redis, including enhanced security features such as password protection. See the Redis security URL and the ownCloud environment variables for more details.
156
169
170
+
== Memcached Configuration
171
+
172
+
If you select Memcached, you must enable it via environment variables. The example value for the host setting assumes that you have used the ownCloud Docker Compose deployment example. Adapt this value for your setup.
173
+
174
+
[source,.env]
175
+
----
176
+
OWNCLOUD_MEMCACHED_ENABLED=true
177
+
OWNCLOUD_MEMCACHED_HOST=memcached
178
+
OWNCLOUD_MEMCACHED_PORT=11211
179
+
----
180
+
181
+
////
182
+
[NOTE]
183
+
====
184
+
If you are using multiple memcached servers, omit `OWNCLOUD_MEMCACHED_PORT` and use the following notation:
The Memcached cache can be flushed from the command line, using a range of common Linux/Unix tools including netcat and telnet. The following example uses telnet to log in, run the flush_all command, and log out:
206
+
207
+
[source,bash]
208
+
----
209
+
telnet <memcached-hostname> 11211
210
+
flush_all
211
+
quit
212
+
----
213
+
157
214
== Deployment Type Configuration Examples
158
215
159
216
These examples provide an overview. Adapt them to suit your environment and needs.
0 commit comments