"Configure a Memcache for Better Performance in Nextcloud" » History » Version 2
Gareth Eaton, 04/08/2023 10:00 AM
1 | 1 | Gareth Eaton | h1. "Configure a Memcache for Better Performance in Nextcloud" |
---|---|---|---|
2 | |||
3 | No memory cache has been configured. To enhance performance, please configure a memcache, if available. Further information can be found in the documentation ↗. |
||
4 | |||
5 | 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. |
||
6 | |||
7 | 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. |
||
8 | |||
9 | The documentation link provided in the message should have more information on how to configure a memcache for your Nextcloud instance. |
||
10 | |||
11 | To enable Memcached, you will need to follow these steps: |
||
12 | |||
13 | 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: |
||
14 | <pre> |
||
15 | sudo apt-get install memcached |
||
16 | </pre> |
||
17 | |||
18 | <pre> |
||
19 | sudo apt-get install php-memcached |
||
20 | </pre> |
||
21 | |||
22 | Edit your Nextcloud configuration file config.php to enable Memcached. Uncomment the following lines if they are commented out: |
||
23 | |||
24 | <pre> |
||
25 | 'memcache.local' => '\OC\Memcache\Memcached', |
||
26 | 'memcached_servers' => array(array('localhost', 11211)), |
||
27 | </pre> |
||
28 | |||
29 | 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. |
||
30 | |||
31 | Restart your web server and Memcached service: |
||
32 | <pre> |
||
33 | sudo service apache2 restart |
||
34 | sudo service memcached restart |
||
35 | 2 | Gareth Eaton | </pre> |
36 | 1 | Gareth Eaton | |
37 | 2 | Gareth Eaton | --- |
38 | |||
39 | You can check if Memcached is running by using the following command in the terminal: |
||
40 | |||
41 | <pre> |
||
42 | systemctl status memcached |
||
43 | 1 | Gareth Eaton | </pre> |
44 | 2 | Gareth Eaton | |
45 | This will display the status of the Memcached service. If it is running, you should see a message indicating that it is active (running). |
||
46 | |||
47 | If it is not running, you can start it using the command: |
||
48 | <pre> |
||
49 | sudo systemctl start memcached |
||
50 | </pre> |
||
51 | |||
52 | If you want to check if Memcached is listening on the correct port, you can use the following command: |
||
53 | |||
54 | <pre> |
||
55 | telnet localhost 11211 |
||
56 | </pre> |
||
57 | If it connects successfully, that means Memcached is listening on the port 11211. |