From ad9439afe166fa5ad808a7376c3a8db4cb514805 Mon Sep 17 00:00:00 2001 From: exu Date: Wed, 10 Jan 2024 19:42:30 +0100 Subject: [PATCH] Add PHP and locking memcache with APCu and Redis for Nextcloud --- pages/02.linux/nextcloud/default.en.md | 38 ++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/pages/02.linux/nextcloud/default.en.md b/pages/02.linux/nextcloud/default.en.md index 22c4591..066185c 100644 --- a/pages/02.linux/nextcloud/default.en.md +++ b/pages/02.linux/nextcloud/default.en.md @@ -121,6 +121,44 @@ systemctl restart apache2 [/shroot] +### PHP Memory Cache + +[shroot] + +```sh +apt install php-apcu +``` + +[/shroot] + +```php +'memcache.local' => '\OC\Memcache\APCu', +``` + +### Redis memcache + +[shroot] + +```sh +apt install redis php-redis +``` + +[/shroot] + +If Redis is installed on the same machine, unix sockets can be used to communicate. + +Add these lines to `config.php` + +```php +'filelocking.enabled' => true, +'memcache.locking' => '\OC\Memcache\Redis', +'redis' => array( + 'host' => '/var/run/redis/redis.sock', + 'port' => 0, + 'timeout' => 0.0, +), +``` + ### Cron To execute regular jobs, I personally use cron.