Upload and download speed issues

Nextcloud version (eg, 29.0.5): Nextcloud Hub 8 (29.0.4)
Operating system and version (eg, Ubuntu 24.04): ubuntu (server) 24.04
Apache or nginx version (eg, Apache 2.4.25): im using the 29.0.4-apache version of nextcloud
PHP version (eg, 8.3): 8.2.21 cli

The issue you are facing:
upload and download speed

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

Steps to replicate it:

  1. normal install of nextcloud through docker compose
  2. disable a bunch of apps and keep what i want, edit php and add cron jobs
  3. now upload or download through the browser

The output of your Nextcloud log in Admin > Logging:

There are no errors except some minor temporary stuff which shouldnt be a probelm
	
Request does not pass strict cookie check

"Jul 27, 2024, 10:30:45 PM"	

Error	richdocuments	
ConnectException
cURL error 28: Resolving timed out after 5000 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://###/hosting/discovery
Failed to fetch discovery: cURL error 28: Resolving timed out after 5000 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://###/hosting/discovery

"Jul 27, 2024, 9:55:15 PM"	

Error	richdocuments	
ConnectException
cURL error 28: Resolving timed out after 5000 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://###/hosting/discovery
Failed to fetch discovery: cURL error 28: Resolving timed out after 5000 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://###/hosting/discovery

"Jul 27, 2024, 9:55:15 PM"	

Error	richdocuments	
ConnectException
cURL error 28: Resolving timed out after 5000 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://###/hosting/capabilities
Failed to fetch capabilities: cURL error 28: Resolving timed out after 5000 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://###/hosting/capabilities

"Jul 27, 2024, 9:55:09 PM"	

Error	richdocuments	
ConnectException
cURL error 28: Resolving timed out after 5000 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://###/hosting/capabilities
Failed to fetch capabilities: cURL error 28: Resolving timed out after 5000 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://###/hosting/capabilities

"Jul 27, 2024, 9:55:09 PM"	

Error	PHP	
dns_get_record(): A temporary server error occurred. at /var/www/html/lib/private/Http/Client/DnsPinMiddleware.php#113


The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'redis',
    'password' => '###',
    'port' => 6379,
  ),
  'upgrade.disable-web' => true,
  'instanceid' => '###',
  'passwordsalt' => '###',
  'overwriteprotocol' => 'https',
  'secret' => '###',
  'trusted_domains' =>
  array (
    0 => '###',
    1 => '###',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '29.0.4.1',
  'overwrite.cli.url' => '###',
  'dbname' => 'nextcloud',
  'dbhost' => 'mariadb',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '###',
  'installed' => true,
);

The output of your Apache/nginx/system log in /var/log/____:

for some reason i cannot open these, when catting or nanoing it just loads forever. but there is only a access.log and a error.log aswell as a other-vhost-access.log

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

The exact same as i it was before, there are a few errors that is there because i have dabled with collabora a bit. nothing after that.

The thing and problem is that im not getting the near max speed i could and it is a bit too slow for not only my liking but my use case. the server has gigabit internett and is located in my home, the pc im uploading/downloading from has 500 mpbs, this should give me i would say a minimum of 50 mb/s if not more. i have tried Pydio, Seafile, owncloud and filebrowser and ONLY in filebrowser have i managed speeds over 50 mb/s there it is actully very fast. hardware is not a bottleneck. i get under 20 mb/s upload and 30 mb/s download. Chunk size change has not helped at all. im reverse proxying through ngnix proxy manager but even on public ip it is slow. only on local ip is it fast and then it is very fast.
Free download manager manages download speed exceding 60 mb/s.
i have heard of multiple people managing to saturate a gig internett on nextcloud, and btw a normal install not in docker does not help. Feel free to ask more questions if needed. Thank you.

Please post your Compose file.

Also, provide the output of occ config:list system from inside the app container since the Docker image uses multiple config files.

Lastly, can you give us a better idea of where NPM is in your network topology?

compose file:

version: '3.8'

services:
  nextcloud:
    image: nextcloud:29.0.4-apache
    container_name: nextcloud
    environment:
      MYSQL_HOST: ####
      MYSQL_DATABASE: ####
      MYSQL_USER:####
      MYSQL_PASSWORD: ####
      REDIS_HOST: redis
      REDIS_HOST_PASSWORD:####
    volumes:
      - /mnt/SSD/Nextcloud:/var/www/html
    depends_on:
      - mariadb
      - redis
    networks:
      - backend
    ports:
      - 8080:80

  mariadb:
    image: mariadb:latest
    container_name: mariadb
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: ####
      MYSQL_DATABASE: #####
      MYSQL_USER: ####
      MYSQL_PASSWORD: ####
    volumes:
      - db_data:/var/lib/mysql
    networks:
      - backend

  redis:
    image: redis:latest
    container_name: redis
    restart: always
    command: redis-server --requirepass ####
    networks:
      - backend

  cron:
    image: nextcloud:29.0.4-apache
    container_name: nextcloud-cron
    entrypoint: ["/bin/sh", "-c", "while true; do php -f /var/www/html/cron.php; sleep 300; done"]
    volumes:
      - /mnt/SSD/Nextcloud:/var/www/html
    depends_on:
      - nextcloud
    networks:
      - backend

volumes:
  db_data:
  nextcloud_data:

networks:
  backend:

The occ config list

{
    "system": {
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "upgrade.disable-web": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "overwriteprotocol": "https",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "192.168.1.155:8080",
            "####"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "29.0.4.1",
        "overwrite.cli.url": "http:\/\/192.168.1.155:8080",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true
    }
}

Lastely my network setup.

so my router has fiber connection symetrical 1 gig. it goes by ethernet to a hex s in bridge mode, that has only one current connection(to my mini pc)
speedtest shows 900 up and down with some fluctuations, sometimes higher sometimes a little bit lower(this is most likely becouse other stuff is taking internett.)
my mini pc has proxmox running with three vms, one vm running an important program, it is running on an internal m.2 sata. then a General one for General purpose running on an external m.2 nvme ssd pcie 4, over usb c with 10 gbps transfer speed(this vm has npm on it). Then my storage vm that is also running on a usbc nvme, the nvme is a tb so i have enough storage to give to the os of the Nextcloud service, everything except config files and files people upload is stored on the nvme. Then i have a HDD connected with 2 tb running at 180 mb/s (tested).
so summery: Nextcloud runs on a seperate vm than the reverse proxy, the reverse proxy points to the vms ip and port and does its magic.
also force ssl, http2 support is on aswell as block common exploits and my advanced is

client_body_buffer_size 512k;
proxy_buffers 4 32k;
client_header_buffer_size 512k;