Downloading from/uploading to external storage is painfully slow (30kb/s)

Hi there!

I just installed Nextcloud on an Ubuntu box with Snap. I set up an SFTP external storage with 4096-bit RSA public key authentication. It works. But it’s really slow.

Using Nextcloud to download/upload files from internal storage ~8mb/s.
Using Nextcloud to download/upload files from external storage gives me ~30kb/s.
The Nextcloud server monitor displays low CPU load (Load average: 0.05) and low memory pressure (Total: 1.9 GB - Current usage: 514.4 MB, SWAP Total: 0 B - Current usage: 0 B) while uploading/downloading.

Using scp to transfer files between the 2 boxes works fine:

  • Transfer from external storage to nextcloud box: 19.7mb/s
  • Transfer from nextcloud box to external storage : 20.9mb/s

Nextcloud version: 13.0.4
Operating system and version: Ubuntu 16.04.4 LTS
Apache or nginx version: Apache/2.4.33 (Unix) OpenSSL/1.0.2g
PHP version: PHP/7.1.17

Is this the first time you’ve seen this error?: Yes.

The nextcloud.log file is empty.

I did not touch the config.php.

I’m not sure if any of the Apache error logs are related to my issue.

$ cat /var/snap/nextcloud/7658/apache/logs/error_log
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Fri Jun 29 20:30:36.182094 2018] [mpm_event:notice] [pid 4102:tid 140162544637824] AH00489: Apache/2.4.33 (Unix) configured -- resuming normal operations
[Fri Jun 29 20:30:36.182190 2018] [core:notice] [pid 4102:tid 140162544637824] AH00094: Command line: 'httpd -d /snap/nextcloud/7658 -D FOREGROUND'
[Fri Jun 29 20:30:36.188394 2018] [unixd:alert] [pid 4110:tid 140162544637824] AH02155: getpwuid: couldn't determine user name from uid 4294967295, you probably need to modify the User directive
[Fri Jun 29 20:30:36.188669 2018] [unixd:alert] [pid 4108:tid 140162544637824] AH02155: getpwuid: couldn't determine user name from uid 4294967295, you probably need to modify the User directive
[Fri Jun 29 20:30:36.188868 2018] [unixd:alert] [pid 4109:tid 140162544637824] AH02155: getpwuid: couldn't determine user name from uid 4294967295, you probably need to modify the User directive
[Fri Jun 29 20:39:59.687583 2018] [mpm_event:notice] [pid 4102:tid 140162544637824] AH00491: caught SIGTERM, shutting down
[Fri Jun 29 20:40:01.393277 2018] [ssl:warn] [pid 5199:tid 140483012020096] AH01909: 127.0.1.1:443:0 server certificate does NOT include an ID which matches the server name
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Fri Jun 29 20:40:01.402794 2018] [ssl:warn] [pid 5199:tid 140483012020096] AH01909: 127.0.1.1:443:0 server certificate does NOT include an ID which matches the server name
[Fri Jun 29 20:40:01.403820 2018] [mpm_event:notice] [pid 5199:tid 140483012020096] AH00489: Apache/2.4.33 (Unix) OpenSSL/1.0.2g configured -- resuming normal operations
[Fri Jun 29 20:40:01.403860 2018] [core:notice] [pid 5199:tid 140483012020096] AH00094: Command line: 'httpd -d /snap/nextcloud/7658 -D EnableHTTPS -D EnableHSTS -D FOREGROUND'
[Fri Jun 29 20:40:01.405013 2018] [unixd:alert] [pid 5202:tid 140483012020096] AH02155: getpwuid: couldn't determine user name from uid 4294967295, you probably need to modify the User directive
[Fri Jun 29 20:40:01.406117 2018] [unixd:alert] [pid 5201:tid 140483012020096] AH02155: getpwuid: couldn't determine user name from uid 4294967295, you probably need to modify the User directive
[Fri Jun 29 20:40:01.407305 2018] [unixd:alert] [pid 5200:tid 140483012020096] AH02155: getpwuid: couldn't determine user name from uid 4294967295, you probably need to modify the User directive
[Fri Jun 29 20:40:26.434333 2018] [unixd:alert] [pid 5310:tid 140483012020096] AH02155: getpwuid: couldn't determine user name from uid 4294967295, you probably need to modify the User directive

I’d really like to troubleshoot this issue. Any help would be appreciated!

The snap images are known to have limited options to optimize it on your setup:

I think the image was built to run on a raspberry pi. Like this it is a pity to not being able to use all your RAM to increase performance.