Drop in performance when accessing files from outside of the local network

Nextcloud version (eg, 18.0.2): 20.0.2
Operating system and version (eg, Ubuntu 20.04): Debian 10
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.38
PHP version (eg, 7.1): 7.3

The issue you are facing:

Hi there,

When I download my NC hosted files from the web client within my local network (FritzBox 4040, 1GBit LAN, LTE) my files are transmitted at a speed of roughly 120 Mbit/s which seems okay. Nothing to complain about.

But when I leave my local network and access the same file with the same setup the download speed drops to around 250-400 Kbit/s with only occasional short peaks upward every one minute or so.

The connections to the internet for both the server and the client are fine and stable. I’ve conducted a speedtest at the same time and it resulted in 40Mbit/s down and 17MBit/s up for the server and similar rates for the client side.

It seems that somehow transmissions get “clogged” once the files are accessed from outside the network. During this clogged transmissions I’ve monitored iotop and htop and the results show only an insignificant load to cpu, memory, swap and disk i/o. The whole NC server is almost idle during those transmissions.

The bottom line is that transmission rates drop to 1/40th of the practically reachable speed once the file access happens from outside the network. All other applications work fine and transmission rates generally are good to excellent (proven by carrying out a web based speedtest).

Probably, someone has experienced a similar behaviour and has an idea what could be the problem. Is it a WebDAV issue? If yes, why is it only observable when accessing the files from outside of the server’s local network and not from within?


Is this the first time you’ve seen this error? (Y/N): N

Steps to replicate it:

  1. Access NC via web browser from outside your server’s network
  2. Download any file to the local hard disk
  3. Observe download rates and compare them to the download rates of accessing the same file within the network

There’s not normally any functional difference as far as Nextcloud whether the files are accessed locally or remotely. Could be something to do with your router.

What is your web client? The same, internally and externally?
How do you connect to the network, internally and externally: LAN? WiFi? LTE?

Yes, it’s the same client: I use Windows 10 / Firefox on my laptop to access my NC server. When connected to the router via WIFI or LAN, transmission rates are fine.

When the laptop is connected via cell phone (USB tethering or Hotspot) or via my other access point offsite the transmission rates are lousy as described above.

All connections are LTE based and are working fine according to the speed tests (tens of MBits/s stable).

I’ve just upgraded to php 7.4 but that didn’t help. Fpm, apcu, opcache have been activated since installation a couple of months ago.

Checking the router’s settings hasn’t revealed anything unusual.


What is that other access point? Also LTE-based?
How do you get inside from the outside? DMZ on the FritzBox?

yes, the other access point is LTE-based, too! I do not have an explicit DMZ on the FritzBox.

My NC installation runs on a virtual machine (Windows 10 VirtualBox with NAT and port forwarding). The physical Windows machine is connected to the LTE-FritzBox via ethernet LAN.

Then it most likely is what Karl said - something to do with NAT-ing in you FritzBox…