From 7ed7cd7cbbb391b937994550ce8871eb022a422b Mon Sep 17 00:00:00 2001 From: Jos Poortvliet Date: Wed, 6 Jan 2016 21:20:23 +0100 Subject: [PATCH 1/2] Update caching_configuration.rst Added recommendations & noted that Redis can and should be uses for filelocking. --- .../caching_configuration.rst | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/admin_manual/configuration_server/caching_configuration.rst b/admin_manual/configuration_server/caching_configuration.rst index 94bead9e1..c1815b0cf 100644 --- a/admin_manual/configuration_server/caching_configuration.rst +++ b/admin_manual/configuration_server/caching_configuration.rst @@ -181,6 +181,10 @@ Redis for the local server cache:: 'password' => '', // Optional, if not defined no password will be used. ), +For best performance, use Redis for file locking by adding this:: + + 'memcache.locking' => '\OC\Memcache\Redis', + .. note:: For enhanced security it is recommended to configure Redis to require a password. See http://redis.io/topics/security for more information. @@ -207,3 +211,40 @@ Cache Directory Location The cache directory defaults to ``data/$user/cache`` where ``$user`` is the current user. You may use the ``'cache_path'`` directive in ``config.php`` (See :doc:`config_sample_php_parameters`) to select a different location. + +Recommendation Based on Type of Deployment +------------------------------------------ + +Small/private home server +^^^^^^^^^^^^^^^^^^^^^^^^^ + +Only use APCu:: + + 'memcache.local' => '\OC\Memcache\APCu', + +Small organization, single-server setup +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Use APCu for local caching, Redis for file locking:: + + 'memcache.local' => '\OC\Memcache\APCu', + 'memcache.locking' => '\OC\Memcache\Redis', + 'redis' => array( + 'host' => 'YOUR_CHOICE', + 'port' => YOUR_CHOICE, + 'timeout' => 0.0, + ), + +Large organization, clustered setup +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Use Redis for everything:: + + 'memcache.distributed' => '\OC\Memcache\Redis', + 'memcache.locking' => '\OC\Memcache\Redis', + 'memcache.local' => '\OC\Memcache\APCu', + 'redis' => array( + 'host' => 'YOUR_CHOICE', + 'port' => YOUR_CHOICE, + 'timeout' => 0.0, + ), From 021026316cc1fa9226086d1be7bd835349349d87 Mon Sep 17 00:00:00 2001 From: Jos Poortvliet Date: Thu, 7 Jan 2016 17:37:05 +0100 Subject: [PATCH 2/2] implement comments Implemented all comments Also removed mentions of ``` 'timeout' => 0.0,``` everywhere as it makes not much sense according to Lukas. --- .../caching_configuration.rst | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/admin_manual/configuration_server/caching_configuration.rst b/admin_manual/configuration_server/caching_configuration.rst index c1815b0cf..71ca6e80d 100644 --- a/admin_manual/configuration_server/caching_configuration.rst +++ b/admin_manual/configuration_server/caching_configuration.rst @@ -150,7 +150,7 @@ Redis ----- Redis is an excellent modern memcache to use for both distributed caching, and -as a local cache with :doc:`Transactional File Locking +as a local cache for :doc:`Transactional File Locking <../configuration_files/files_locking_transactional>` because it guarantees that cached objects are available for as long as they are needed. @@ -177,7 +177,6 @@ Redis for the local server cache:: 'redis' => array( 'host' => 'localhost', 'port' => 6379, - 'timeout' => 0.0, 'password' => '', // Optional, if not defined no password will be used. ), @@ -196,7 +195,6 @@ recommended if Redis is running on the same system as ownCloud) use this example 'redis' => array( 'host' => '/var/run/redis/redis.sock', 'port' => 0, - 'timeout' => 0.0, ), Redis is very configurable; consult `the Redis documentation @@ -230,21 +228,19 @@ Use APCu for local caching, Redis for file locking:: 'memcache.local' => '\OC\Memcache\APCu', 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( - 'host' => 'YOUR_CHOICE', - 'port' => YOUR_CHOICE, - 'timeout' => 0.0, + 'host' => 'localhost', + 'port' => 6379, ), Large organization, clustered setup ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Use Redis for everything:: +Use Redis for everything except local memcache:: 'memcache.distributed' => '\OC\Memcache\Redis', 'memcache.locking' => '\OC\Memcache\Redis', 'memcache.local' => '\OC\Memcache\APCu', 'redis' => array( - 'host' => 'YOUR_CHOICE', - 'port' => YOUR_CHOICE, - 'timeout' => 0.0, + 'host' => 'localhost', + 'port' => 6379, ),