Slow/Limited Upload Speed

Hey there,

I installed nextcloud a few days ago following the guide from nextcloud.com. When I first tested my setup everything worked like a charm except two things: the webinterface was very slow and the upload speed was unstable. The uploadspeed varied between 12MB/s and 1MB/s. I decided to tune my server according to the docs from nextcloud.com. I enabled opcache, installed redis/apcu, optimized the cache and resources for mariadb etc. After I tuned everything the webinterface became amazingly fast and responsive but there is still the problem with the uploadspeed. The upload is now stable but for some reason its capped at 2MB/s.
Download works perfectly with 10MB/s

What I did:
I tested my connection several times with test files from Hetzner, speedtests, upload to other clouds/services and I get the 100mbit/s every single time.
Tested the speed of my server → 1Gbit/s up/down
Tested nextcloud uploadspeed from webinterface and clients → 2MB/s
Rebooted the server several times
Tested speed to my storage with webdav and sftp → server to storage 1Gbit/s (webdav is slower)up/down; pc@home to storage 100Mbit/s up/down

I test the upload/download speed to my nextcloud server with a 100mb and 1gb file.

What could cause this 2MB/s limit?

Server specs: 2 core, 4gb
Storage is mounted via sftp (sshfs)
Server side encryption enabled
Nextcloud version (18)
Operating system (Ubuntu 18.04)
Apache (Apache 2.4.29)
PHP version (7.2-fpm)

   <?php
   $CONFIG = array (
'instanceid' => 'XXX',
  'passwordsalt' => 'XXX',
  'secret' => 'XXX,
  'trusted_domains' => 
  array (
    0 => 'example.com,
  ),
  'datadirectory' => '/path/to/mounteddata',
  'dbtype' => 'mysql',
  'version' => '18.0.0.10',
  'overwrite.cli.url' => 'example.com',
  'dbname' => 'XXX',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'XXX',
  'dbpassword' => 'XXX',
  'installed' => true,
  'maintenance' => false,
  'mysql.utf8mb4' => true,
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
//  'memcache.local' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => [
     'host' => '/var/run/redis/redis-server.sock',
     'port' => 0,
     'timeout' => 0.0,
  ],
   );
4 Likes

Is this a local sftp storage? I’d try with “normal” Nextcloud storage first.

This could create some shortage of resources. I’d check the system’s resources used while you upload something.

That usually has a large impact on the upload performance as well. Especially redis and then the database tuning.