# Download takes a long time to start, but download speed is then very fast

**URL:** <https://help.nextcloud.com/t/download-takes-a-long-time-to-start-but-download-speed-is-then-very-fast/62501>\
**Category:** ℹ️ Support\
**Tags:** nc16\
**Created:** [October 22, 2019, 12:09pm UTC](https://help.nextcloud.com/t/download-takes-a-long-time-to-start-but-download-speed-is-then-very-fast/62501 "2019-10-22T12:09:26Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![nxcl](https://help.nextcloud.com/letter_avatar/nxcl/32/5_5575768a8748004e209b776fc1b2916d.png) [@nxcl](https://help.nextcloud.com/u/nxcl)\
**Post date:** [October 24, 2019, 9:13am UTC](https://help.nextcloud.com/t/download-takes-a-long-time-to-start-but-download-speed-is-then-very-fast/62501/9 "2019-10-24T09:13:49Z")

</div>

I have now also adapted my www.conf + restarted apache2 and php  
but there was no improvement.

```
[www]
user = www-data
group = www-data
listen = /run/php/php7.3-fpm.sock
listen.owner = www-data
listen.group = www-data
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
pm.max_requests = 500
env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp

```

According to the article

> [@High cpu load on apache V16.0.0.5](https://help.nextcloud.com/t/high-cpu-load-on-apache-v16-0-0-5/62180/9):
>
> Since I user the Beta 17 CPU Load is very moderate. As you can see in the graphics before I upgraded CPU load was 100% (6 Cores in a vm). some before it was 50% or e bit more. So it tooks CPU power more and more sincs the Upgrade end of september. After I upgrade to the beta 17 its very low, you can see it also in the graphics.

updating to NC17 could resolve the problem  
… ???

When downloading a file it’s over this link:  
[https://mydomain.de/remote.php/webdav/ubuntu-18.04.2-live-server-amd64.iso](https://mydomain.de/remote.php/webdav/ubuntu-18.04.2-live-server-amd64.iso)  
May be there is a problem in remote.php or Webdav?

remote.php:

```
<?php
/**
 * @copyright Copyright (c) 2016, ownCloud, Inc.
 *
 * @author Brice Maron <brice@bmaron.net>
 * @author Christopher Schäpers <kondou@ts.unde.re>
 * @author Joas Schilling <coding@schilljs.com>
 * @author Jörn Friedrich Dreyer <jfd@butonic.de>
 * @author Lukas Reschke <lukas@statuscode.ch>
 * @author Robin Appelman <robin@icewind.nl>
 * @author Robin McCorkell <robin@mccorkell.me.uk>
 * @author Thomas Müller <thomas.mueller@tmit.eu>
 * @author Vincent Petry <pvince81@owncloud.com>
 *
 * @license AGPL-3.0
 *
 * This code is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License, version 3,
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License, version 3,
 * along with this program. If not, see <http://www.gnu.org/licenses/>
 *
 */

require_once __DIR__. '/lib/versioncheck.php';

use OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin;
use Sabre\DAV\Exception\ServiceUnavailable;
use Sabre\DAV\Server;

/**
 * Class RemoteException
 * Dummy exception class to be use locally to identify certain conditions
 * Will not be logged to avoid DoS
 */
class RemoteException extends Exception {
}

/**
 * @param Exception|Error $e
 */

```

![image](https://help.nextcloud.com/uploads/default/original/3X/b/4/b41e90d5f7fccaa1d009c7a6b0ebd15820dff118.png)

Anyone a idea how to reduce this? TTFB

---

_[View the full topic](https://help.nextcloud.com/t/download-takes-a-long-time-to-start-but-download-speed-is-then-very-fast/62501)._
