Optimization beyond Server tuning documentation

After optimizing all I could, I still need an average of ~7 to 9s on Safari/Chrome/FF (on an old but powerful Macbook) to fully load the Dashboard page (same for most other pages, except Activity < 2s, and Calendar ~5s, and photo which takes much longer).
I’m speaking local network access conditions, with latency <3ms and 1Gb connection.

I’ve followed the doc in https://docs.nextcloud.com/server/22/admin_manual/installation/server_tuning.html# and optimized as indicated.
Postgres DB, APCu local cache, TLS handled by Traefik reverse proxy, H2 protocol.

It’s a Docker setup using 22.2.2-apache image, running on Ubuntu 21.10, itself a VM on a FreeBSD Bhyve hypervisor (agreeingly not the best for performance). It’s got plenty of CPUs and RAM and sits pretty much idle.
And the instance has very little data (a few info in the Calendar which actually takes up 1-2s load time to show up on dashboard)

But it’s on the fastest NVMe I could find and transitioning to it has proven the best optimization so far.

I feel I could probably win something in loading time by having the NC instance run on a container on a native Linux setup or even on baremetal, but it feels it’s not that kind of performance that is causing the slow loading time.

Besides I’ve got plenty of other containers on that same setup that feels very snappy on load time.

I can see on browsers network dev tools that pages are pretty heavy. But still, static objects are fast to load.
The page loading starts to slow down when XHR type requests start to kick in. And there’re quite a few of them on most pages.
So it seems to indicate that the framework itself is slow to process these, or that there are too many per pages, or something is too slow somewhere in these calls anyway.

I’m surely not the first person asking about this. Are there any topics, bugs, performance ticket opened that I could follow?

Please also test with another operation system (e.g. Windows, Linux, Android, iOS) and with another brother.

Do you access the website with a local ip, local domain or a dyn dns name?

Perhaps the problem is Hairpinning / NAT Loopback and a wrong router config.
Can you access your nextcloud from the internet (mobile, internet at friends) faster?

I’m using a proper domain name with an IPv6 stack, doing self-hosting.
So there shouldn’t be any NAT issue with IPv6 and even if my router doesn’t route me through the loopback the latency is within 3ms.
I don’t see any issue here.
Just tested with local Android, about same, and a Windows pc through a corporate VPN, and timing is in line with a Dashboard total loading time slightly under 15s.

As I was saying, all the static assets load very fast, like <25ms after an initial eastablishing session time. It’s really once all the XHR requests starts that it takes time to get answers (~200 to 500ms, but many of them)

Maybe I need to be more specific about my Dashboard, I see it’s configurable.
It’s loading widgets My files, Talk (empty) and Upcoming events (the later being pretty slow, always the last one to start and finish)

And let’s be honest, it’s not that I consider it ultra-slow with regards to all the content it serves.
But still, it’s feels a little too long. Having total loadtime within 5s would seem reasonable to me.

Actually I don’t mind sharing a test user for people to be able to make a quick access test and give me their feedback.
Is that a safe thing to do ?

I hit slow load times with NC21/22 as well. Shortly I tried assigning more RAM for PHP - changed from default 512MB to 1024MB and for me it really made a noticeable change - initial load, switching tabs and browsing in files is much faster - unfortunately I didn’t made any measurements so I can’t quantify how much…

Hey, how did you configure that?
I’m not sure which kind of ram allocation you mean.
Surely you’re not speaking of server RAM, probably some PHP settings?

It is apache2-php-ram (memory_limit). You can read this and set it for your apache2-php-version.
Or read this (sorry german).

Yes PHP RAM

It seems all taken care of in the Docker install:

/usr/local/etc/php/conf.d/nextcloud.ini
contains
memory_limit=${PHP_MEMORY_LIMIT}

Though I’m not too sure where this var comes from, but i’d be surprised if this wasn’t taken care of and set to a proper value.

yes it is an environment variable and is set by default to 512M until you don’t change on your own… for me assigning 1G made visible change…

Initially with NC19 I had the feeling 512MB was enough… but 1G is better now (maybe because of the switch to php 8)

@coolnodje
Overwrites this the apache2-php.ini configuration?
If not also test the default apache2-php-configurations see above.