# Memcache - how to enable

**URL:** <https://help.nextcloud.com/t/memcache-how-to-enable/2651>\
**Category:** ℹ️ Support\
**Created:** [August 26, 2016, 3:17pm UTC](https://help.nextcloud.com/t/memcache-how-to-enable/2651 "2016-08-26T15:17:11Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![MichaIng](https://help.nextcloud.com/user_avatar/help.nextcloud.com/michaing/32/2125_2.png) [@MichaIng](https://help.nextcloud.com/u/MichaIng)\
**Post date:** [February 5, 2017, 4:35pm UTC](https://help.nextcloud.com/t/memcache-how-to-enable/2651/4 "2017-02-05T16:35:19Z")

</div>

Actually for nextcloud local caching APCu is recommended and seems to perform best. It should also work, if php-apcu module is installed.

As far as I understand from your config, your nextcloud is running and using only one server? In this case distributed memcache is useless, if I am not completely mistaken ;). So you can just remove `'memcache.distributed'` line and `'memcached_servers'` array completely from your `config.php` and things should run just the same.

As mentioned, ask your webhost for php apcu, and use `'memcache.local' => '\OC\Memcache\APCu',` in case.

Next thing would be transactional file locking with redis: [https://docs.nextcloud.com/server/10/admin\_manual/configuration\_server/caching\_configuration.html#id4](https://docs.nextcloud.com/server/10/admin_manual/configuration_server/caching_configuration.html#id4)

If redis is installed and configured i.e. as this:

> /etc/redis/redis.conf  
> port 0  
> …  
> unixsocket /var/run/redis/redis.sock  
> unixsocketperm 770

you could use

> ```
> .../nextcloud/config/config.php
> 'filelocking.enabled' => 'true',
> 'memcache.locking' => '\OC\\Memcache\\Redis',
> 'redis' => array (
> 'host' => '/var/run/redis/redis.sock',
> 'port' => 0,
> 'timeout' => 0.0,
> ),
> 
> ```

to enable it for nextcloud.

---

_[View the full topic](https://help.nextcloud.com/t/memcache-how-to-enable/2651)._
