Nextcloud version (eg, 12.0.2): 16.0.5
Operating system and version (eg, Ubuntu 17.04): Debian GNU/Linux 10 (buster)
Apache or nginx version (eg, Apache 2.4.25): 2.4.38
PHP version (eg, 7.1): 7.3.9
Run through NextcloudPi within Docker on a Raspi 4B - 4GB with extensive cooling and a great power supply.
The issue you are facing:
Everything is so slow.
Everything is so slow since minute 1. I spent the past week tweaking my installation to my needs and now I have come to optimize the installation, just to find out it already was optimized by default. I tried searching different methods of optimization, but all I found was already applied.
At first, I had the entire installation on my Transcend 300S SD card (very high quality) and it was slow. Now I moved the Nextcloud data directory to an HDD. Still slow. No matter what I added/removed/changed with Nextcloud, everything is super slow.
I think the fastest load time I encountered was 10 seconds. Everything else is above that. Sometimes way above that. A couple of times it even took about ~60 seconds to load the Nextcloud page.
I am generally very patient and deal with longer load times with ease but Nextcloud just takes a super long time, that sometimes is unbearable, especially if you quickly just want to drop in something you need.
I have read some older articles on how to optimize Nextcloud. Some suggestions weren’t compatible with my installation, others were already applied. I did not find an up-to-date article, though.
As I use a Raspberry Pi 4B with 4GB RAM available, I have plenty of power to use, I just don’t know how I let Nextcloud use it better.
As this is a new instance, there are so far only 2 users of it.
What can I do to make things faster?
What hardware component has the biggest impact on performance? (Storage, RAM, CPU, etc.)
FAQ:
Q: What feature of Nextcloud causes long load times?
A: Any feature.
Q: What about the hardware XY part?
A: The hardware is perfectly fine and is rigorously tested to work as expected.
Q: Did you install a lot of apps?
A: Apps or a bigger installation don’t have anything to do with that, as it has always been slow since the beginning.
Q: Did you play around with the config or with the database?
A: It is slow since minute 1, before I did anything with the instance after installation.
Is this the first time you’ve seen this error? (Y/N):
No. I installed Nextcloud about 1 year ago already and it was super slow as well. On entirely different hardware, in an entirely different location.
The output of your Nextcloud log in Admin > Logging:
Logs are bloated with stuff that happened when I tried optimizing the instance. Nothing else of intereset to see.
The output of your config.php file in /path/to/nextcloud
(make sure you remove any identifiable information!):
...
'datadirectory' => '/data/nextcloud/data',
'dbtype' => 'mysql',
'version' => '16.0.5.1',
'overwrite.cli.url' => 'url.tld',
'dbname' => 'nextcloud',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
...
'memcache.distributed' => '\\OC\\Memcache\\Redis',
'memcache.local' => '\\OC\Memcache\\APCu',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => '/var/run/redis/redis.sock',
'port' => 0,
'timeout' => 0.0,
...
'tempdirectory' => '/var/www/nextcloud/data/tmp',
'mail_smtpmode' => 'sendmail',
'mail_smtpauthtype' => 'LOGIN',
'mail_from_address' => 'admin',
'mail_domain' => 'ownyourbits.com',
'preview_max_x' => '2048',
'preview_max_y' => '2048',
'jpeg_quality' => '60',
'overwriteprotocol' => 'https',
'maintenance' => false,
'ldapIgnoreNamingRules' => false,
'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
'theme' => '',
'loglevel' => 2,
);