Why is my nextcloud so slow?

Nextcloud version (eg, 10.0.2): 11
Operating system and version (eg, Ubuntu 16.04): Ubuntu 16.04
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.18
PHP version (eg, 5.6): PHP 7.0.3
Is this the first time you’ve seen this error and can you replicate it?: Yes

The issue you are facing:
I installed a fresh nextcloud instance, but up- and downloading is very slow. Hardware is Pentium dualcore, 2gb RAM and 2x500gb HDD.

The maximum upload I get (webdav plugin Total Commander) is about 800 kb/s. Also upload in Browser is comparable slow. It seems to be a problem with WebDav. The Reason I use Total Commander WebDav plugin is, that I can’t add webdav connection in windows :confused:

Download is just fine, it’s about 150mb/s :slight_smile:

Can anyone suggest why i face this issue? Anything configured wrong?

Thanks in Advance

The output of your Nextcloud log in Admin > Logging:
Sabre\DAV\Exception\MethodNotAllowed: HTTP/1.1 405 The resource you tried to create already exists
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 590: Sabre\DAV\Server->createCollection(‘Photos/temp/200…’, Object(Sabre\DAV\MkCol))
[internal function] Sabre\DAV\CorePlugin->httpMkcol(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit(‘method MKCOL’, Array)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php - line 60: Sabre\DAV\Server->exec()
/var/www/nextcloud/remote.php - line 165: require_once(’/var/www/nextcl…’)

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

<?php $CONFIG = array ( 'instanceid' => 'XXX', 'passwordsalt' => 'XXX, 'secret' => 'XXX', 'trusted_domains' => array ( 0 => '', 1 => 'ubuntu-server', ), 'datadirectory' => '/var/www/nextcloud/data', 'overwrite.cli.url' => '', 'dbtype' => 'mysql', 'version' => '', 'dbname' => 'nextcloud', 'dbhost' => 'localhost', 'dbport' => '', 'dbtableprefix' => 'oc_', 'dbuser' => 'XXX', 'dbpassword' => 'XXX', 'logtimezone' => 'UTC', 'installed' => true, ); The output of your Apache/nginx/system log in `/var/log/____`: [Tue Jan 31 16:22:34.805537 2017] [:error] [pid 1928] [client] script '/var/www/html/remote.php' not found or unable to stat [Tue Jan 31 16:29:02.310412 2017] [mpm_prefork:notice] [pid 1135] AH00169: caught SIGTERM, shutting down [Tue Jan 31 16:30:11.735856 2017] [mpm_prefork:notice] [pid 1273] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations [Tue Jan 31 16:30:11.802561 2017] [core:notice] [pid 1273] AH00094: Command line: '/usr/sbin/apache2' [Tue Jan 31 19:48:16.581673 2017] [mpm_prefork:notice] [pid 1273] AH00169: caught SIGTERM, shutting down [Tue Jan 31 19:49:55.553037 2017] [mpm_prefork:notice] [pid 1090] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations [Tue Jan 31 19:49:55.582485 2017] [core:notice] [pid 1090] AH00094: Command line: '/usr/sbin/apache2' [Tue Jan 31 20:37:40.554020 2017] [authz_core:error] [pid 1416] [client] AH01630: client denied by server configuration: /var/www/nextcloud/data/.$data/.ocdata

@RoMaTiX99 have you installed memcached or APCu?

Did you force rescan the files in Ubuntu:

cd /var/www/nextcloud
sudo -u www-data php console.php files:scan --all

thanks for your reply!

up to now i didn’t set up apcu, because the php7 package wasn’t named php7.0-apcu … but i now found the solution (simply had to install php-apcu) … so yes, now it’s configured. But now change in upload speed :confused: … but the warning in admin panel doesn’t appear anymore :slight_smile:

filescan is running … edit: but didn’t changed the game :frowning:

I think I have got an similar problem. Also using Ubuntu 16.04 but on a raspberry pi 3 b. Also very slow up- and download. Also using version 11.0.0

Some brain storms:

Have to tried basic Ubuntu troubleshooting like journalctl or systemctl, dmesg, etc.

Have you run apt update / apt upgrade

Have you rebooted the system… (Conflicts can be solved this way too)

SWAP size, as you are low on physical ram, have you catered for a swap at least of the same amount?

What is the health of the CPU, temperature, etc.

So … didn’t found anything in ubuntu troubleshooting logs you mentioned.

server is up to date and of course i rebooted multiple times :smiley:

Ram and Swap is 2GB.

cpu is at maximal 10% (its a Pentium E7200) and temperature is between 34 and 40 degree.

Is there anything you can configure wrong in php/webdav config?
btw: i mentioned, that download is not always that fast … often just about 1,5 mb/s … could it be a problem with my network?

Redis cache for file locking, then database tuning can do a huge difference:

(it’s still an old post from owncloud, some things have improved a bit but I didn’t test it recently)

My last 2c :wink:

Is BIOS and firmware up-to-date

If you have raid, check raid settings, write through or write back depending on your drives. Probably you have an issue with BIOS write back. For drives that have a spindle speed of 5400 rpm go for write through. I had a similar issue and this was the problem.

If problem persists then I would recommend a full re-install. Follow this step by step guide as its very good https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-nextcloud-on-ubuntu-16-04

okay thank you …

I’ll do reinstall asap.

thanks for your help

Ok, I admit that I am a ted finicky about hardware, but my rule of thumb is not to rush to the install before making 100% sure that the hardware and its respective firmware is up to date. CPU temperature of 34 and 40 degree is not to my liking. I have rack servers running at 8 to 10 degrees celsius, chassis overall temperatures of 15 degrees.

  • Generally I strip down all parts and clean all the golden pins with alcohol.
  • Clean off all thermal grease from all coolers (note all and not just the cpu ones) and reapply new.
  • Usually I clear NVRAM - its a jumper on servers, don’t know about yours
  • Bootup and make and check all the BIOS settings are to be correct. Make sure if you have raid set and managed through a controller, then check the settings of such and check for the HDDs spindle rate and the manufacturer recommended raid controller settings. Particular note the write through and write back.
  • Remove any partitions from the HDDs, run a complete format
  • Once all done, then head to install Ubuntu and NextCloud as per the tutorial.

This should solve the issues for you. Just to get you in the picture, at home I have a Dell PowerEdge 1950 Gen II server dual Xeon E5335 with 8Gb RAM, 2TB WD NAS Red Drives (Raid Level 1) and ubuntu installed on a 32Gb USB. Ubuntu and NextCloud work like a charm off the usb and the raided drives are set as external local storage for NextCloud and a DLNA server. I will be tweaking this set-up more with better CPUs and hopefully convert the HDDS to the latest M.2 SSDs

@RoMaTiX99 as to timing, have a look at the test I conducted here NextCloud synchronisation mechanics - WOL compliant maybe?

On this test it took a healthy set-up about 30 seconds to sync a 10kb file across client pcs over encrypted traffic.

Do you mean the core temperature of your CPU’s is 8-10 Celsius, and the chassi temp is 15 Celsius? If so, what is your room temperature?

@Eazy the data center at work has controlled and duct injected air temperature set at 16 degrees for spring, summer and autumn (currently its off as the operating ambient temperature within the servers would be at an average of 20 degrees), at home I work off room ambient temperatures which currently (being winter) varies between 8 to 12 degrees. Here is a screenshot I just captured from iDRAC of a live PowerEdge r710 server with dual E5520 cpus that is nearing its quarterly service (clean-up). Sorry cannot get you bios screenshots of CPU temperatures as this as its currently live (production).

Operating system and power management optimization will get you CPU - number of cores, core temperatures and power consumption down to meet the right demand.

I am also working on a “mission” so to say to get the NextCloud servers to hibernate and be activated by wake-on-lan. This will yield us a saving of over 45% of power consumption from an energy audit we just performed. The trouble I am facing is with Ubuntu 16.04 as such hibernation cannot function despite a swap of 64gb…

Hi fab,

I have encountered an issue. When i try to download multiple files in parallel the speed of the download is decreased as expected because the bandwidth is then shared by the downloads. But, my problem is that when i cancel one of those downloads the speed does not rise again to the normal speed which i see in case of single download. to get things back to normal i have to restart my raspberry pi. Can you please point out the issue and help me with the solution.?

Best Regard:

@junaid_aslam I have no idea as I don’t use PI. I presume its a buffer issue (of the onboard NIC) that has been committed on the original transfer at lower layers of the OSI (TCP connection establishment, etc.) As you reboot the PI, this will be empty therefore solves your problem.

I use rack servers and the multiple port NIC cards have their own buffers and controllers which are able to adapt and load balance even at layer 3 of the OSI, I guess the PI has no such thing due to its size.

@fab Thank you for your valuable insight. I will try to see what can be a possible solution to this. I have one more question. I sometimes get bad gateway error even though the PI is connected to the internet. Can you please tell me how it could happen.? And what could be a possible solution if you ever saw this issue.

@junaid_aslam as I mentioned, I don’t use PIs so I have never experienced troubleshooting with these SoCs. Bad Gateways could mean:

  • Simply DHCP lease errors
  • Router (or ISP modem) issues
  • NIC buffer issues
  • NGIX or Apache issues
  • Ubuntu issues.

Try search on PI forums on this. Personally, I have always set Nextcloud to run on static IPs

i am also trying to figure out why transfers are so slow in nextcloud. samba share i can crank out and average of 112MB per sec but nextcloud transfers at a 4th of the speed