nextcloud配置缓存
nextcloud/config/config.php
'memcache.local' => '\OC\Memcache\APCu',
'memcache.locking' => '\OC\Memcache\Redis',
'redis' => [
'host' => '127.0.0.1',
'port' => 6379,
],
参考文档
https://docs.nextcloud.com/server/14/admin_manual/configuration_server/caching_configuration.html
小型/私人家庭服务器
仅使用 APCu:
'memcache.local' => '\OC\Memcache\APCu' ,
小型组织,单服务器设置
使用 APCu 进行本地缓存,使用 Redis 进行文件锁定:
'memcache.local' => '\OC\Memcache\APCu',
'memcache.locking' => '\OC\Memcache\Redis',
'redis' => array(
'host' => 'localhost',
'port' => 6379,
),
大型组织,集群设置
对除本地 memcache 之外的所有内容使用 Redis:
'memcache.distributed' => '\OC\Memcache\Redis',
'memcache.locking' => '\OC\Memcache\Redis',
'memcache.local' => '\OC\Memcache\APCu',
'redis' => array(
'host' => 'localhost',
'port' => 6379,
),
Redis 与 APCu 关于内存缓存的附加说明
APCu 在本地缓存方面比 Redis 更快。如果您有足够的内存,请使用 APCu 进行内存缓存和 Redis 进行文件锁定。如果内存不足,请同时使用 Redis。