Nextcloud version: Nextcloud Hub 8 (29.0.3)
Operating system and version: Linux 6.8.0-38-generic x86_64
Apache or nginx version: Apache as installed by AIO
PHP version: PHP as installed by AIO (8.2, despite 8.3 being suggested elsewhere)
,
Version: 8.2.21
Memory limit: 512 MB
Max execution time: 3600
Upload max size: 10 GB
OPcache Revalidate Frequency: 60
Extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, hash, iconv, json, mbstring, SPL, session, PDO, pdo_sqlite, bz2, posix, random, readline, Reflection, standard, SimpleXML, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, cgi-fcgi, apcu, bcmath, Phar, exif, ftp, gd, gmp, igbinary, imagick, imap, intl, ldap, memcached, pcntl, pdo_pgsql, pgsql, redis, smbclient, sodium, sysvsem, zip, libsmbclient, Zend OPcache
Database:
Type: pgsql
Version: PostgreSQL 16.3 on x86_64-pc-linux-musl, compiled by gcc (Alpine 13.2.1_git20240309) 13.2.1 20240309, 64-bit
Size: 19.2 MB
CPU: Intel(R) Xeon(R) Platinum 8173M CPU @ 2.00GHz (10 cores)
Memory: 9.01 GB
Filesystem: ext4
Size: 95.81 GB
Available: 89.31 GB
The issue you are facing:
Slow instance
Is this the first time you’ve seen this error?
N
I had NextCloud installed behind a NGINX for almost a year and always was unhappy with its speed (3.5 seconds HTTP HEAD ping time, unusable).
Assuming this was user error and I did something wrong on install I scraped the whole thing and re-installed with the official installation guidelines found here GitHub - nextcloud/all-in-one: 📦 The official Nextcloud installation method. Provides easy deployment and maintenance with most features included in this one Nextcloud instance..
Despite several suspicions flags in that process (such as for example several documentation instances saying we should use PHP 8.3 and that recommended, official installer installing PHP 8.2, or several instances in doc saying we should use MySQL and that installer using Postgres, or its instructions of how to install Docker pointing to a install method that is not suggested for production by docker itself), I followed the steps by the letter and all went well.
The only difference to the suggested method in my instance is that I installed docker the way it should be installed on production over the “convenience script” (and I used the proper curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
over the deprecated etc/apt/keyrings
. But this really shouldn’t (and doesn’t) affect performance.
I use a KVM VPS as suggested by the installer process as well, and as seen in the above specs, the machine is total overkill for the task at hand. My NC instance as but two users, one of which did not even sign in yet ever.
The only extra I use is the Antivirus. No Encryption is in place, Imaginary is active, talk is active, that’s about it. Standard apps like calendar, notes, cards are active, but unused.
On this new install indeed speed became better (down to 1.5 s HEAD ping).
I am across the globe from the physical location of my server, and .7s HEAD PING is expected. Not 1.5.
All of my other servers (all located on the same host, country and with WAY less powerful specs), are up to double/triple as quick responding, with severely more complex target pages.
Of course the difference is, they don’t run NC, they run either Custom PHP Code instances of some sort, or WordPress, or Typesense and so on.
My question… what can I do?
I find the server specs a total overkill for this, and decreasing them to about half of all specs does not really affect speed, indicating the issue isn’t the server.
I find 1.6 seconds ping on a bare “landing page” (the log in page, since pings cannot see the backend) an extremely slow performance.
Since I used AIO install, all the “improvements” (I understand) are made, such as cache, memory settings, etc etc etc.
I checked all admin screens and there are no warnings anywhere (as opposed to my previous install which had a number of warnings)
Humanly felt, the speed is really slow too, its not just the machine saying that.
Login page literally takes about 1, 1.5 seconds (as far as a human can count precisely lol).
The backend is even worse. Sometimes I I have to wait 2, 3 seconds for dashboard to completely load.
Auditing the logged out front end, Lighthouse report an awful score, saying the initial server response time is second-most at fault. Yet, as we know, the server can’t be at fault, because I am 100% sure those servers work very well in any other case, just not when NC is on them.
It further says the logo is the first-most faulty and flags it as largest content paint taking staggering 4 seconds to load. Analyzing the logo I see NC loads an SVG (even if I did not add an SVG) which is barely 200px square rendered. An SVG cannot take 4 seconds to load, this is literal nonsense (and in fact if I call the url of that SVG it is, of course, blazing fast to load). The only I could imagine is that it does some (expensive) processing behind the scenes every time the logo is loaded and transforms it from png to svg?
I guess those two issues are what makes both the machine and the human see very slow speeds
Yet, I am at a loss of how to resolve that. Its nothing I appear to be under control of.