It’s difficult to say so generally. Is it slow like “unusable slow”? Or is it just “slower” than in your LAN? Beacause to some extent this is normal.
The performance outside of your LAN mainly depends on the upload speed your ISP offers you. The second important factor is of course the speed of the internet connection from which you access your Nextcloud (e.g. cellular network, WiFi, office network…) Other factors could be DNS, your router etc…
Is it slow with the external ip from your internal network or from every networks in the internet? Test access from mobile network or ask your friends.
If first point search NAT Loopback and Hairpinning
Your picture shows only the download speed of your internet connection. Relevant for external access is the upload speed. If you click on “show more info”, then you can see the Upload speed at the bottom on the right side. Or use https://www.speedtest.net. It’s more accurate imho.
Ok Maybe it is not more accurate in this case. Download speed seems a little low on this. Anyways…
Asuming that that this is your connection at home or wherever your Nextcloud server resides, 20mps is not a superfast connection but it should be more than good enough to make your Nextcloud usable from outside your network. At least the login page loads reasonable fast for me. (btw. you left all your realworld data in the config details you posted incl. database passwords etc.).
I think we need more info about your router config, network setup etc… And myabe you could describe “unusable slow” in a little more details, like how many seconds pass if you click on something and how you access your nextloud when you are outside of your network. I think the problem is either the connection from where you try to access your server or maybe your router/firewall…
Hello, i found the root cause of slowness, it was "Collabora Online - Built-in CODE Server "
I disabled the module and every thing goes ok.
But is there any solution for that?
Hard to say, could be the webserver/reverse proxy configuration, could be your router. Some routers have bad performance with NAT-Loopback. Did you add both domains (nextcloud and collabora) to your hosts file with the internal IP? I still think that your browser maybe not uses the hosts file or the entries in the hosts file maybe don’t work. Make sure that your browser uses the DNS/Proxy-Settings of your system and not some external DNS or DNS over HTTPS or something like that. Did you test the hosts file entries with nslookup? Other than that I begin to run out of ideas…
As other solution has indicated, disabling “Collabora Online - Built-in CODE Server” has helped, but in my case, I don’t think I have Collabora Online - Built-in CODE Server installed (at least not in the installed apps section).
If this happens inside your local network, it’s most likely due to your router badly handling NAT loopback / hairpin NAT.
If it is happening from outside the local network, I would have to ask how and from where you tested it and how slow it really is. I mean 10mbps upload is not super fast and you will definitely always notice a difference compared to a LAN connection. But it also depends on the speed of the internet connection you are connecting from. A crowded company / hotel / public WiFi or bad cell reception can of course also slow things down.
I haven’t tested this outside my home network, but I will test it and see if this issue is only within my network.
One follow-up question though - When I mentioned that it’s slow, I mainly was referring to opening the photos and pages (not uploading them to the nextcloud). Do you think a slow upload connection would be a constraint here?
From inside your LAN, no. But if NAT-reflection is beeing used, the IP address of every packet has to be re-written to the routers public IP address, which of course costs the router CPU time. Generally spekaing NAT-Reflection / Hairpinning is kind of a “hack” and should be avoided if performance is a concern.
From outside your LAN, probably yes. Files always need to be downloaded to view or edit them. And if you’re outside your loacal network these downloads will be limited by the upload speed of your home internet connection. So how significant the constraint will be depends mainly on the size of the files you are working with.
I signed up - JUST to respond to this thread because it helped me!
I had this same problem where it connected slow via WAN (when i say slow, i mean, it would take 3-4 MINUTES just to load the login page)- tried different ports, different NICs, routes, Port forwards, Inside/outside DMZ with no luck. I set up another server for another person and had the same issue (DSL, over cable, now) either it was my process, or something is wrong with the system.
i found this article and (painstakingly, via WAN) i turned off the CODE server and VOILA! OH. My. GOD YES! It is still a bit slow, but i believe that to be due to their slow upstream but it ACTUALLY works.
my process -
LAN speeds no issues (loads no different than this website we’re on right now)
via fqdn slow (with or without https)
via ip address had same speed issue
combination of with/without FQDN and only WAN, same issue
combination of only WAN and no LAN, same issue
turned off CODE server and it immediately resolved it (once the command completed)
edit: fqdn still a bit slow but not nearly AS slow. WAN IP works flawless.