Slow download speed over www, locally its fine

kinoe

New Member
Feb 13, 2023
5
0
1
Problem:
NextcloudPi (LXC, installed by script) downloading big files (<500 MB) via public internet connection: speed is very poor (transfer rates ~100KBytes/sec, bitrates ~1Mbits/sec, should be around 15 MB/s) though via LAN within the local network download speed is fine (via public IP/ domain.name and without VPN)

Question:
What am I missing to debug and eliminate the bottleneck of the network(settings)?
I'm grateful for any help and hint!

Setup:
Proxmox running NginxProxyManager, AdguardHome and NextcloudPi as LXC, no firewall running yet, PHP 8.1
- NginxProxyManager as reverse proxy and load balancer with LetsEncrypt, http/2, force ssl and advanced NextcloudPi settings for getting carddav and caldav syncronized
- AdguardHome with DNS-over-TLS, with or without forced https
- NextcloudPi with Redis Server, Apache2
- Mullvad VPN with DNS server set to AdguardHome localIP
<?php
$CONFIG = array (
'passwordsalt' => '***********************',
'secret' => '**************************',
'trusted_domains' =>
array (
0 => 'localhost',
1 => '<local ipv4 address of my NC instance>'',
11 => '<dynamic public ipv4 address of my NC instance>'',
5 => 'nextcloudpi.local',
8 => 'nextcloudpi.lan',
14 => 'nextcloudpi.home',
3 => 'mydomain.tld',
),
'datadirectory' => '/var/www/nextcloud/data',
'dbtype' => 'mysql',
'version' => '25.0.3.2',
'overwrite.cli.url' => 'https://mydomain.tld/',
'dbname' => 'nextcloud',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'ncadmin',
'dbpassword' => '*********************************',
'installed' => true,
'instanceid' => '**********',
'memcache.local' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => '/var/run/redis/redis.sock',
'port' => 0,
'timeout' => 0.0,
'password' => '***************************',
),
'tempdirectory' => '/var/www/nextcloud/data/tmp',
'trashbin_retention_obligation' => 'auto, 10',
'mail_smtpmode' => 'sendmail',
'mail_smtpauthtype' => 'LOGIN',
'mail_from_address' => 'admin',
'mail_domain' => 'ownyourbits.com',
'default_phone_region' => 'DE',
'preview_max_x' => '2048',
'preview_max_y' => '2048',
'preview_max_memory' => 256,
'jpeg_quality' => '60',
'overwriteprotocol' => 'https',
'allow_local_remote_servers' => true,
'trusted_proxies' =>
array (
11 => '127.0.0.1',
12 => '::1',
0 => '<local ipv4 address of my Nginx Proxy Manager>',
14 => '<dynamic public ipv4 address of my NC instance>',
1 => '<ipv6 address>',
13 => 'mydomain.tld',
),
'maintenance' => false,
'loglevel' => '2',
'log_type' => 'file',
'has_rebuilt_cache' => true,
'logfile' => '/var/www/nextcloud/data/nextcloud.log',
'data-fingerprint' => '******************',
'theme' => '',
'enable_previews' => true,
'enabledPreviewProviders' =>
array (
0 => 'OC\\Preview\\Movie',
1 => 'OC\\Preview\\PNG',
2 => 'OC\\Preview\\JPEG',
3 => 'OC\\Preview\\GIF',
4 => 'OC\\Preview\\BMP',
5 => 'OC\\Preview\\XBitmap',
6 => 'OC\\Preview\\MP3',
7 => 'OC\\Preview\\MP4',
8 => 'OC\\Preview\\TXT',
9 => 'OC\\Preview\\MarkDown',
10 => 'OC\\Preview\\PDF',
),
'enforce_theme' => '',
);

Hardware:
- Kernel and CPU: Linux 6.1.10-1-pve on x86_64
- Processor information: Intel(R) Celeron(R) N5100 @ 1.10GHz, 4 cores
- Real memory: 1.79 GiB used / 2.58 GiB cached / 7.55 GiB total
- Virtual memory: 256 KiB used / 7.55 GiB total
- Local disk space: 24.52 GiB used / 974.95 GiB free / 999.47 GiB total
- Package updates: All installed packages are up to date

What I tried so far following several net founds:
- debugging with iperf3, speedtest-cli and attempts to download from public internet
- Proxmox-kernel upgrade, with and without kernel parameter: "intel_idle.max_cstate=1"
- increased PHP memory limit to 512 and 1025 MB
- maximum file size: 10 GB
- enabled and disabled systemd-resolved
- nginx reverse proxy: custom locations= /dns-query. Advanced settings: proxy_request_buffering off; client_max_body_size 0; proxy_buffering off;
- adjusting MTU: using 1492 in the guest instead of 1500 which is set on the host
 
Last edited:
Are you using https internally aswell?
Is the speed only slow in this guest, or also in others (both VM and LXC)?
Are you absolutely certain that your public connection and the server you're connecting to should give you 15MB?
 
Thanks for taking an interest and your help
Are you using https internally aswell? -- yes
Is the speed only slow in this guest, or also in others (both VM and LXC)? -- > no VMs running yet. Actual speedtest in all LXCs ~ 7.5 Mbit/s. This is half capacity of what should be and yet 7 times faster than DL speed in nextcloud container!
Are you absolutely certain that your public connection and the server you're connecting to should give you 15MB? --> yes: speedtest on my pc: download = 14.43 Mbit/s
 
Is the VPN always used in the external network? On host or in lxc? Basically, when a connection goes through the public network, is there anything different than if it were local?

Try giving your LXC all available cores and remove any cpu limit.
What's your config? `pct config ID`
 
Is the VPN always used in the external network? On host or in lxc? -> I don't use a VPN in context with Proxmox (but on my pc/laptop) Basically, when a connection goes through the public network, is there anything different than if it were local? -> symptomatically its the download speed what makes the difference. I can't recall of any other differences i.e. in relation to any settings or configs. Help me on my way to get what you meant (something like forced https or other settings?).

Try giving your LXC all available cores and remove any cpu limit. --> will increase those
What's your config? `pct config ID`
Bash:
pct config 101
arch: amd64
cores: 2
description: # NextCloudPi LXC%0A### https://tteck.github.io/Proxmox/%0A
features: nesting=1
hostname: nextcloudpi
memory: 2048
mp0: /media/ncp/data,mp=/shared
net0: name=eth0,bridge=vmbr0,hwaddr=1A:4B:05:AF:C3:9F,ip=dhcp,mtu=1480,type=veth
onboot: 1
ostype: debian
rootfs: local-lvm:vm-101-disk-0,size=10G
swap: 512

But undersized resources should be a slowdowner and bottleneck in any circumstance, shouldn't they? not only when downloading from an outside client but from inside my home network too? but the latter is no problem.

My DNS settings:
Proxmox node:
-- dns server = ipv4 address of the adguard dns server
-- search domain = "home" (?.. adguard is set to use DNS-over-TLS so maybe it should be my FQDN of the dns server???)
LXC 'nextcloudpi':
-- dns server = use values from host
-- search domain = use values from host
 
Last edited:
But undersized resources should be a slowdowner and bottleneck in any circumstance, shouldn't they? not only when downloading from an outside client but from inside my home network too? but the latter is no problem.
Yes, that's why I asked if you're using a VPN in the container. Maybe a router on the local network that has not enough CPU? stuff like that
At the moment, I can't think of anything else
 
Thanks a lot anyway.
Edit: No one else got an idea?
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!