file locking
Posted: Sun May 14, 2023 10:36 am
I figured it out!
For anyone who was having problems diagnosing file locking and Redis, hit this endpoint (as an admin) and see what it says:
https://[YOUR NEXTCLOUD HOSTNAME]/ocs/v2.php/apps/serverinfo/api/v1/info
As it turns out, this endpoint gives you a lot of useful debugging info, including whether Redis is used for caching. In my case, it wasn’t.
<memcache.local>\OC\Memcache\APCu</memcache.local>
<memcache.distributed>none</memcache.distributed>
<filelocking.enabled>yes</filelocking.enabled>
<memcache.locking>none</memcache.locking>
And it turned out that the file I was editing in my Docker configs was being copied to the wrong place! Once I figured it out, I was able to update my config file:
<?php
$CONFIG = array (
'filelocking.enabled' => 'true',
'memcache.local' => '\OC\Memcache\Redis',
'memcache.locking' => '\OC\Memcache\Redis',
'redis' => array(
'host' => 'redis',
'port' => 6379,
),
);
After moving it to my Nextcloud install (under the config directory), I’m now using Redis for caching and locking!
<memcache.local>\OC\Memcache\Redis</memcache.local>
<memcache.distributed>none</memcache.distributed>
<filelocking.enabled>yes</filelocking.enabled>
<memcache.locking>\OC\Memcache\Redis</memcache.locking>
It remains to be seen if this solves the file locking issues I saw, but at least I have a chance of that now.
For anyone who was having problems diagnosing file locking and Redis, hit this endpoint (as an admin) and see what it says:
https://[YOUR NEXTCLOUD HOSTNAME]/ocs/v2.php/apps/serverinfo/api/v1/info
As it turns out, this endpoint gives you a lot of useful debugging info, including whether Redis is used for caching. In my case, it wasn’t.
<memcache.local>\OC\Memcache\APCu</memcache.local>
<memcache.distributed>none</memcache.distributed>
<filelocking.enabled>yes</filelocking.enabled>
<memcache.locking>none</memcache.locking>
And it turned out that the file I was editing in my Docker configs was being copied to the wrong place! Once I figured it out, I was able to update my config file:
<?php
$CONFIG = array (
'filelocking.enabled' => 'true',
'memcache.local' => '\OC\Memcache\Redis',
'memcache.locking' => '\OC\Memcache\Redis',
'redis' => array(
'host' => 'redis',
'port' => 6379,
),
);
After moving it to my Nextcloud install (under the config directory), I’m now using Redis for caching and locking!
<memcache.local>\OC\Memcache\Redis</memcache.local>
<memcache.distributed>none</memcache.distributed>
<filelocking.enabled>yes</filelocking.enabled>
<memcache.locking>\OC\Memcache\Redis</memcache.locking>
It remains to be seen if this solves the file locking issues I saw, but at least I have a chance of that now.