What is limiting upload performance (web & Android)?

Nextcloud version: 20.0.9
Operating system and version: Ubuntu 20.04 LTS
Apache or nginx version: Apache 2.4.46-4+deb.sury.org+1+ubuntu20.04.1+deb.sury.org+5
PHP version: 7.4.3-4ubuntu2.4

I am wondering how to work out why upload speeds are very limited when using either the web interface or, especially, the Android app. Examples:

Desktop (connected via 10GbE):

  • Copying to Nextcloud data directory via SMB = 300+ MB/s
  • Uploading via web interface (Firefox 87) = 33 MB/s

Phone (connected via 5 GHz WiFi):

  • iperf to server = 50-60 MB/s
  • Uploading via FTP or SMB = 40 MB/s
  • Uploading via Android app = 2-3 MB/s (!)

Clearly the server/network/disks are perfectly capable of receiving files much faster than the Nextcloud web interface or Android apps are working at. I’m wondering if this is normal and just Nextcloud and/or WebDAV being slow, or is this something I can debug and sort out?

This is all on an internal network, no internet bottleneck. All tests are with one large file, so it’s not overhead from processing lots of small files. 2 of the CPU cores on server hit ~25% usage each during Android uploads, so not exactly taxing. There is nothing in the Nextcloud logs during uploads. I find it interesting that the apache logs say it’s using HTTP/1.1 when using the Android app but HTTP/2.0 via Firefox - presumably a limitation of the Android app?

Nextcloud config.php file:

<?php
$CONFIG = array (
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' => 
  array (
    0 => 'mydomain',
  ),
  'datadirectory' => '/data/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '20.0.9.1',
  'overwrite.cli.url' => 'https://mydomain/nc',
  'overwriteprotocol' => 'https',
  'dbname' => '',
  'dbhost' => '',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '',
  'dbpassword' => '',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_from_address' => '',
  'mail_domain' => '',
  'mail_smtpsecure' => 'tls',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtphost' => '',
  'mail_smtpport' => '587',
  'mail_smtpauth' => 1,
  'mail_smtpname' => '',
  'mail_smtppassword' => '',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'maintenance' => false,
  'theme' => '',
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'loglevel' => 1,
  'mail_sendmailmode' => 'smtp',
  'updater.release.channel' => 'stable',
  'filesystem_check_changes' => 1,
  'onlyoffice' => 
  array (
    'verify_peer_off' => true,
  ),
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' => 
  array (
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
  ),
  'app_install_overwrite' => 
  array (
    0 => 'files_snapshots',
  ),
);

Apache access.log during Android upload:

192.168.1.123 - - [09/Apr/2021:11:09:00 +0100] "GET /nextcloud/index.php/204 HTTP/1.1" 204 1671 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.15.1"
192.168.1.123 - - [09/Apr/2021:11:09:00 +0100] "HEAD /nextcloud/remote.php/webdav/20210219_124530.mp4 HTTP/1.1" 200 1193 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.15.1"
192.168.1.123 - - [09/Apr/2021:11:09:01 +0100] "GET /nextcloud/index.php/204 HTTP/1.1" 204 1673 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.15.1"
192.168.1.123 - - [09/Apr/2021:11:09:01 +0100] "GET /nextcloud/index.php/204 HTTP/1.1" 204 1669 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.15.1"
192.168.1.123 - - [09/Apr/2021:11:09:01 +0100] "GET /nextcloud/index.php/204 HTTP/1.1" 204 1669 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.15.1"
192.168.1.123 - - [09/Apr/2021:11:09:01 +0100] "HEAD /nextcloud/remote.php/webdav/20210219_124530.mp4 HTTP/1.1" 200 831 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.15.1"
192.168.1.123 - - [09/Apr/2021:11:09:03 +0100] "PROPFIND /nextcloud/remote.php/webdav/20210219_124530.mp4 HTTP/1.1" 207 1571 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.15.1"
192.168.1.123 - - [09/Apr/2021:11:09:05 +0100] "GET /nextcloud/index.php/204 HTTP/1.1" 204 1673 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.15.1"
192.168.1.123 - - [09/Apr/2021:11:09:05 +0100] "HEAD /nextcloud/remote.php/webdav/20210219_124530.mp4 HTTP/1.1" 200 831 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.15.1"
192.168.1.123 - - [09/Apr/2021:11:09:05 +0100] "MKCOL /nextcloud/remote.php/dav/uploads/user/3bb4f57a1c37b09726044acd080b0efd HTTP/1.1" 201 608 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.15.1"
192.168.1.123 - - [09/Apr/2021:11:09:05 +0100] "PROPFIND /nextcloud/remote.php/dav/uploads/user/3bb4f57a1c37b09726044acd080b0efd HTTP/1.1" 207 1946 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.15.1"
192.168.1.123 - - [09/Apr/2021:11:09:05 +0100] "PUT /nextcloud/remote.php/dav/uploads/user/3bb4f57a1c37b09726044acd080b0efd/0000000000000000-0000000010239999 HTTP/1.1" 201 790 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.15.1"
192.168.1.123 - - [09/Apr/2021:11:09:07 +0100] "PUT /nextcloud/remote.php/dav/uploads/user/3bb4f57a1c37b09726044acd080b0efd/0000000010240000-0000000020479999 HTTP/1.1" 201 790 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.15.1"
192.168.1.123 - - [09/Apr/2021:11:09:09 +0100] "PUT /nextcloud/remote.php/dav/uploads/user/3bb4f57a1c37b09726044acd080b0efd/0000000020480000-0000000030719999 HTTP/1.1" 201 790 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.15.1"
192.168.1.123 - - [09/Apr/2021:11:09:10 +0100] "PUT /nextcloud/remote.php/dav/uploads/user/3bb4f57a1c37b09726044acd080b0efd/0000000030720000-0000000040959999 HTTP/1.1" 201 790 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.15.1"
192.168.1.123 - - [09/Apr/2021:11:09:12 +0100] "PUT /nextcloud/remote.php/dav/uploads/user/3bb4f57a1c37b09726044acd080b0efd/0000000040960000-0000000051199999 HTTP/1.1" 201 790 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.15.1"
192.168.1.123 - - [09/Apr/2021:11:09:13 +0100] "PUT /nextcloud/remote.php/dav/uploads/user/3bb4f57a1c37b09726044acd080b0efd/0000000051200000-0000000057982442 HTTP/1.1" 201 790 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.15.1"
192.168.1.123 - - [09/Apr/2021:11:09:14 +0100] "MOVE /nextcloud/remote.php/dav/uploads/user/3bb4f57a1c37b09726044acd080b0efd/.file HTTP/1.1" 204 876 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.15.1"
192.168.1.123 - - [09/Apr/2021:11:09:16 +0100] "PROPFIND /nextcloud/remote.php/webdav/20210219_124530.mp4 HTTP/1.1" 207 1571 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.15.1"
192.168.1.123 - - [09/Apr/2021:11:09:16 +0100] "GET /nextcloud/index.php/apps/files/api/v1/thumbnail/256/256/20210219_124530.mp4 HTTP/1.1" 404 822 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.15.1"
192.168.1.123 - - [09/Apr/2021:11:09:17 +0100] "GET /nextcloud/index.php/204 HTTP/1.1" 204 1675 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.15.1"
192.168.1.123 - - [09/Apr/2021:11:09:17 +0100] "GET /nextcloud/index.php/204 HTTP/1.1" 204 1671 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.15.1"

An update: I’ve executed the following command to disable file chunking:

sudo -u www-data php occ config:app:set files max_chunk_size --value 0

My numbers are now slightly better but still nowhere near what I’d expect:

Desktop (connected via 10GbE):

  • Uploading via web interface (Firefox 87) = ~55 MB/s (hard to tell since it keeps flipping between 35 and 70 MB/s)

Phone (connected via 5 GHz WiFi):

  • Uploading via Android app = 6-7 MB/s

Any other ideas?

Hi,
i do have a similar problem. My Android phone upload files autoamtically. Usaully i upload photos and video files.
Today i uploaded a 500 MB file with the android app in about 20 Minutes. Before that i tried to upload the same file from the same phone, but with a browser and it took only 5 Minutes.
In both cases i am using exactly the same wifi connectio at the same location.
Therefore - i think the connection is capable of uloading the 500 MB in 5 Minutes.
I read about the chunking - but i am not sure if chunk setting effects the speed of the upload only in the web browser, or if it affects the WEB DAV interface only.

My nextcloud is running on a raspberry pi3 with 1GB of RAM. I am quite not sure, if i can disable the chunking on this machine as the resources are limited…

I was hoping Nextcloud 21 might improve things given its release note focuses on performance but it didn’t. Still getting ~5 MB/s via the Android app on a LAN.