installing_apcu_memcache_nextcloud_27_0_ubuntu_22_04

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
installing_apcu_memcache_nextcloud_27_0_ubuntu_22_04 [2023/06/25 06:02] wikiadmininstalling_apcu_memcache_nextcloud_27_0_ubuntu_22_04 [2023/06/25 06:28] (current) – [Contents of config.sample.php with respect to MemCache Configuration] wikiadmin
Line 97: Line 97:
 Refresh your Nextcloud admin page, and the cache warning should disappear. In other words, while logged into NextCloud as an 'admin' group user, access or refresh "Overview" in the "Administration" menu section and the warning message, that a memcache has not been installed, is gone. Well, it's gone if everything was done properly.  There is no need at this point to restart the apache2 service in order to obtain this result. Refresh your Nextcloud admin page, and the cache warning should disappear. In other words, while logged into NextCloud as an 'admin' group user, access or refresh "Overview" in the "Administration" menu section and the warning message, that a memcache has not been installed, is gone. Well, it's gone if everything was done properly.  There is no need at this point to restart the apache2 service in order to obtain this result.
  
-**Warning*.*  The NextCloud documentation states that --+**Warning**  The NextCloud documentation states that --
  
 APCu is disabled by default on CLI which could cause issues with nextcloud’s cron jobs. **Please make sure you set the apc.enable_cli to 1 on your php.ini config file** or append --define apc.enable_cli=1 to the cron job call. APCu is disabled by default on CLI which could cause issues with nextcloud’s cron jobs. **Please make sure you set the apc.enable_cli to 1 on your php.ini config file** or append --define apc.enable_cli=1 to the cron job call.
Line 186: Line 186:
  
 Using Redis for local cache on a multi-server setup can cause issues. Also, even on a single-server setup, APCu (see section above) should be faster.  Using Redis for local cache on a multi-server setup can cause issues. Also, even on a single-server setup, APCu (see section above) should be faster. 
 +
 +===== Contents of config.sample.php with respect to MemCache Configuration=====
 +
 +<code>
 +**
 + * Memory caching backend configuration
 + *
 + * Available cache backends:
 + *
 + * * ``\OC\Memcache\APCu``       APC user backend
 + * * ``\OC\Memcache\ArrayCache`` In-memory array-based backend (not recommended)
 + * * ``\OC\Memcache\Memcached``  Memcached backend
 + * * ``\OC\Memcache\Redis``      Redis backend
 + *
 + * Advice on choosing between the various backends:
 + *
 + * * APCu should be easiest to install. Almost all distributions have packages.
 +   Use this for single user environment for all caches.
 + * * Use Redis or Memcached for distributed environments.
 +   For the local cache (you can configure two) take APCu.
 + */
 +
 +/**
 + * Memory caching backend for locally stored data
 + *
 + * * Used for host-specific data, e.g. file paths
 + *
 + * Defaults to ``none``
 + */
 +'memcache.local' => '\OC\Memcache\APCu',
 +
 +/**
 + * Memory caching backend for distributed data
 + *
 + * * Used for installation-specific data, e.g. database caching
 + * * If unset, defaults to the value of memcache.local
 + *
 + * Defaults to ``none``
 + */
 +'memcache.distributed' => '\OC\Memcache\Memcached',
 +
 +/**
 + * Connection details for redis to use for memory caching in a single server configuration.
 + *
 + * For enhanced security it is recommended to configure Redis
 + * to require a password. See http://redis.io/topics/security
 + * for more information.
 + *
 + * We also support redis SSL/TLS encryption as of version 6.
 + * See https://redis.io/topics/encryption for more information.
 + */
 +'redis' => [
 +        'host' => 'localhost', // can also be a unix domain socket: '/tmp/redis.sock'
 +        'port' => 6379,
 +        'timeout' => 0.0,
 +        'read_timeout' => 0.0,
 +        'user' =>  '', // Optional: if not defined, no password will be used.
 +        'password' => '', // Optional: if not defined, no password will be used.
 +        'dbindex' => 0, // Optional: if undefined SELECT will not run and will use Redis Server's default DB Index.
 +        // If redis in-transit encryption is enabled, provide certificates
 +        // SSL context https://www.php.net/manual/en/context.ssl.php
 +        'ssl_context' => [
 +                'local_cert' => '/certs/redis.crt',
 +                'local_pk' => '/certs/redis.key',
 +                'cafile' => '/certs/ca.crt'
 +        ]
 +],
 +
 +/**
 + * Connection details for a Redis Cluster.
 + *
 + * Redis Cluster support requires the php module phpredis in version 3.0.0 or
 + * higher.
 + *
 + * Available failover modes:
 +  - \RedisCluster::FAILOVER_NONE - only send commands to master nodes (default)
 +  - \RedisCluster::FAILOVER_ERROR - failover to slaves for read commands if master is unavailable (recommended)
 +  - \RedisCluster::FAILOVER_DISTRIBUTE - randomly distribute read commands across master and slaves
 + *
 + * WARNING: FAILOVER_DISTRIBUTE is a not recommended setting, and we strongly
 + * suggest to not use it if you use Redis for file locking. Due to the way Redis
 + * is synchronized it could happen, that the read for an existing lock is
 + * scheduled to a slave that is not fully synchronized with the connected master
 + * which then causes a FileLocked exception.
 + *
 + * See https://redis.io/topics/cluster-spec for details about the Redis cluster
 + *
 + * Authentication works with phpredis version 4.2.1+. See
 + * https://github.com/phpredis/phpredis/commit/c5994f2a42b8a348af92d3acb4edff1328ad8ce1
 + */
 +'redis.cluster' => [
 +        'seeds' => [ // provide some or all of the cluster servers to bootstrap discovery, port required
 +                'localhost:7000',
 +                'localhost:7001',
 +        ],
 +        'timeout' => 0.0,
 +        'read_timeout' => 0.0,
 +        'failover_mode' => \RedisCluster::FAILOVER_ERROR,
 +        'user' =>  '', // Optional: if not defined, no password will be used.
 +        'password' => '', // Optional: if not defined, no password will be used.
 +        // If redis in-transit encryption is enabled, provide certificates
 +        // SSL context https://www.php.net/manual/en/context.ssl.php
 +        'ssl_context' => [
 +                'local_cert' => '/certs/redis.crt',
 +                'local_pk' => '/certs/redis.key',
 +                'cafile' => '/certs/ca.crt'
 +        ]
 +],
 +
 +
 +/**
 + * Server details for one or more memcached servers to use for memory caching.
 + */
 +'memcached_servers' => [
 +        // hostname, port and optional weight
 +        // or path and port 0 for unix socket. Also see:
 +        // https://www.php.net/manual/en/memcached.addservers.php
 +        // https://www.php.net/manual/en/memcached.addserver.php
 +        ['localhost', 11211],
 +        //array('other.host.local', 11211),
 +],
 +
 +/**
 + * Connection options for memcached
 + */
 +'memcached_options' => [
 +        // Set timeouts to 50ms
 +        \Memcached::OPT_CONNECT_TIMEOUT => 50,
 +        \Memcached::OPT_RETRY_TIMEOUT =>   50,
 +        \Memcached::OPT_SEND_TIMEOUT =>    50,
 +        \Memcached::OPT_RECV_TIMEOUT =>    50,
 +        \Memcached::OPT_POLL_TIMEOUT =>    50,
 +
 +        // Enable compression
 +        \Memcached::OPT_COMPRESSION =>          true,
 +
 +        // Turn on consistent hashing
 +        \Memcached::OPT_LIBKETAMA_COMPATIBLE => true,
 +
 +        // Enable Binary Protocol
 +        \Memcached::OPT_BINARY_PROTOCOL =>      true,
 +
 +        // Binary serializer vill be enabled if the igbinary PECL module is available
 +        //\Memcached::OPT_SERIALIZER => \Memcached::SERIALIZER_IGBINARY,
 +],
 +
 +
 +/**
 + * Location of the cache folder, defaults to ``data/$user/cache`` where
 + * ``$user`` is the current user. When specified, the format will change to
 + * ``$cache_path/$user`` where ``$cache_path`` is the configured cache directory
 + * and ``$user`` is the user.
 + *
 + * Defaults to ``''`` (empty string)
 + */
 +'cache_path' => '',
 +
 +/**
 + * TTL of chunks located in the cache folder before they're removed by
 + * garbage collection (in seconds). Increase this value if users have
 + * issues uploading very large files via the Nextcloud Client as upload isn't
 + * completed within one day.
 + *
 + * Defaults to ``60*60*24`` (1 day)
 + */
 +'cache_chunk_gc_ttl' => 60*60*24,
 +
 +
 +</code>
 +        
  
installing_apcu_memcache_nextcloud_27_0_ubuntu_22_04.1687672938.txt.gz · Last modified: 2023/06/25 06:02 by wikiadmin