Project

General

Profile

Actions

"Configure a Memcache for Better Performance in Nextcloud"

No memory cache has been configured. To enhance performance, please configure a memcache, if available. Further information can be found in the documentation ↗.

This message means that Nextcloud is not configured to use a memory cache, which can significantly improve its performance. A memory cache is a type of caching system that stores frequently accessed data in RAM (Random Access Memory), making it quickly available to the application.

By default, Nextcloud uses a file cache to store data, which can be slower than a memory cache. The message is suggesting that you configure a memcache if available, which can improve Nextcloud's performance.

The documentation link provided in the message should have more information on how to configure a memcache for your Nextcloud instance.

To enable Memcached, you will need to follow these steps:

Install the Memcached server on your server. This can usually be done using your server's package manager. For example, on Ubuntu, you can use the command:

sudo apt-get install memcached


sudo apt-get install php8.1-memcached

for php 8.2 
sudo apt-get install php-memcached

NOTICE: Not enabling PHP 8.1 FPM by default.
NOTICE: To enable PHP 8.1 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php8.1-fpm

Edit your Nextcloud configuration file config.php to enable Memcached. Uncomment the following lines if they are commented out:

'memcache.local' => '\OC\Memcache\Memcached',
'memcached_servers' => array(array('localhost', 11211)),

If you have installed Memcached on a different server, you will need to replace localhost with the IP address or hostname of your Memcached server.

Restart your web server and Memcached service:

sudo service apache2 restart
sudo service memcached restart


You can check if Memcached is running by using the following command in the terminal:

systemctl status memcached

This will display the status of the Memcached service. If it is running, you should see a message indicating that it is active (running).

If it is not running, you can start it using the command:

sudo systemctl start memcached

If you want to check if Memcached is listening on the correct port, you can use the following command:

telnet localhost 11211

If it connects successfully, that means Memcached is listening on the port 11211.

Updated by Gareth Eaton about 1 year ago · 4 revisions