High system load will slow down Nextcloud and might also lead to other unwanted
side effects. To reduce load you should first identify the source of the problem.
Tools such as htop, iotop or glances
will help to identify the process or the drive that slows down your system. First
you should make sure that you installed/assigned enough RAM. Swap usage should be
prevented by all means. If you run your database inside a VM, you should not
store it inside a VM image file. Better put it on a dedicated block device to
reduce latency due to multiple abstraction layers.

See the section Database configuration for how to
configure Nextcloud for MySQL or MariaDB. If your installation is already running on
SQLite then it is possible to convert to MySQL or MariaDB using the steps provided
in Converting database type.

In smaller installations you might not want to set up a separate cache. However
you can still tune your database. The following example is suited for a database
smaller than 1GB. MySQL will consume up to 1GB of RAM for caching. Please make
sure that your system has sufficient free RAM after the change, so that it does
not start to use your swap partition, when it receives a burst of requests. In
the given example your /etc/mysql/conf.d/mysql.cnf might contain the
following lines. (beware that this is the block for mysqld not mysql)

File locking is enabled by default, using the database locking backend. This
places a significant load on your database. See the section
Transactional file locking for how to
configure Nextcloud to use Redis-based Transactional File Locking.

SSL (HTTPS) and file encryption/decryption can be offloaded to a processor’s
AES-NI extension. This can both speed up these operations while lowering
processing overhead. This requires a processor with the AES-NI instruction set.

Here are some examples how to check if your CPU / environment supports the
AES-NI extension:

For each CPU core present: grepflags/proc/cpuinfo or as a summary for
all cores: grep-m1^flags/proc/cpuinfo If the result contains any
aes, the extension is present.

Search eg. on the Intel web if the processor used supports the extension
Intel Processor Feature Filter You may set a filter by
"AESNewInstructions" to get a reduced result set.

For versions of openssl >= 1.0.1, AES-NI does not work via an engine and
will not show up in the opensslengine command. It is active by default
on the supported hardware. You can check the openssl version via opensslversion-a

If your processor supports AES-NI but it does not show up eg via grep or
coreinfo, it is maybe disabled in the BIOS.

If you are using a default installation of php-fpm you might have noticed
excessive load times on the web interface or even sync issues. This is due
to the fact that each simultaneous request of an element is handled by a
separate PHP-FPM process. So even on a small installation you should allow
more processes to run. For example on a machine with 4GB of RAM and 1GB of
MySQL cache following values in your www.conf file should work: