Download response time

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 12.0.2): 16.0.6
Operating system and version (eg, Ubuntu 17.04): Ubuntu 18.04.3
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.29
PHP version (eg, 7.1): 7.2

The issue you are facing:
I get long response times before a file starts downloading. The larger the file, the longer the response time. After the download starts, speeds are normal. I’m talking ~50s before download starts of a ~512Mb file.
Extra info: data folder is NFS share.

Sorry if this is an amateur question, but this is a home server and I am an amateur :slight_smile: who’s not really familiar with coding (but eager to learn!)

Is this the first time you’ve seen this error? (Y/N): Y (first time I notice it, don’t see an error)

Steps to replicate it:

General, configuration issue?

The output of your Nextcloud log in Admin > Logging:

No entries

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

<?php
$CONFIG = array (
  'instanceid' => '*******',
  'passwordsalt' => '*******',
  'secret' => '*******',
  'trusted_domains' => 
  array (
    0 => '*******',
  ),
  'datadirectory' => '/media/Cloud',
  'dbtype' => 'mysql',
  'version' => '16.0.6.1',
  'overwrite.cli.url' => 'https://*******',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '*******',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
  ),
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_from_address' => '*******',
  'mail_domain' => '*******',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => '*******',
  'mail_smtpport' => '465',
  'mail_smtpname' => '*******@*******',
  'mail_smtppassword' => '*******',
  'maintenance' => false,
  'loglevel' => 2,
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' => 
  array (
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
  ),
  'theme' => '',
  'updater.release.channel' => 'stable',
);

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

Can post particular log if needed.

Can you check if you add a folder on a local disk (e.g. via external storage feature), if there is a delay as well?

And at the same time, if you copy stuff directly on your NC server from NFS storage, is there a delay as well?

Thanks for the reply. Here’s what I did:

  • added local ubuntu folder through external storages app.
  • copied ~550Mb file from NFS folder to mounted local folder using the nextcloud web interface. The copy was fast without delay.
  • downloaded copied file from mounted local folder using nextcloud web interface: same delay as before (~50s) before download starts…

Extra info: using the ios nextcloud app on ipad and iphone the files never even seem to start downloading…

Great, so let’s stay on the local folder and download via web-interface. Can you open top in your terminal and check out which process gets on top when you ask for a file? And check if you have an high i/o-wait:

Can you also check the memory usage (free -m)?

Memory usage shows that during the delay the file I’m trying to download is loaded into memory… Memory is again cleared after the file is downloaded.
Used memory rises from 842Mb to 1,7Gb

So it seems to be apache. Not sure, what it exactly could be. I would check if there are enough connections or too many (or something different), perhaps you can increase logging to get more information in case you don’t find more clues directly.

I’ve been looking into the logs, but still no clue. Is there a way see which scripts are being accessed in realtime by apache?

If you have some time of very low traffic, you could try the debug mode. There everything is logged what apache is doing. It is still challenging finding the needle in the haystack, but it can be things like it does a reverse-dns for your ip for logging.

Perhaps one more thing to try before, just put a large static file on the webserver and download it without php or Nextcloud. If it isn’t the php stuff, I’d do the debug-logging on such a static file. If it is php, I’d look more in the php<->apache setup. Does the number of available connections in php and apache match …

Looks like similar issue: Download takes a long time to start, but download speed is then very fast

2 Likes

the following solved it for me: