Nextcloud login page loading slowly

Hello,
I have installed nextcloud on a VPS server:
6 vCPU Cores
16 GB RAM
500 GB NVMe
400 Mbp/s network connection speed.

The issue is that the login page takes about:
10-15 minutes to load with Cloudflare without Cloudflare it takes 20-30 minutes.

Nothing else is running on the server and it is configured based on the user guides:
https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#

PHP Version:
PHP 8.2.11 (cli) (built: Oct 6 2023 09:47:18) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.11, Copyright (c) Zend Technologies
with Zend OPcache v8.2.11, Copyright (c), by Zend Technologies
with Xdebug v3.2.1, Copyright (c) 2002-2023, by Derick Rethans

MySQL:
mysql Ver 15.1 Distrib 10.6.12-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper

Nextcloud config:

<?php
$CONFIG = array (
  'default_phone_region' => '',
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => 'SomesuperSecureSecret',
  'trusted_domains' => 
  array (
    0 => 'mydomain.com',
  ),
  'datadirectory' => '/super/secure/location/data',
  'dbtype' => 'mysql',
  'version' => '27.1.2.1',
  'overwrite.cli.url' => 'https://SuperSecureDomain.com',
  'dbname' => 'SuperSecureDBname',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'SuperSecureDBUser',
  'dbpassword' => 'SuperSecureDBPassword',
  'installed' => true,
  'auth.bruteforce.protection.enabled' => false,
  'mail_from_address' => 'myeamil@mydomain.com',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'mydomain.com',
  'mail_smtpport' => '465',
  'mail_smtphost' => 'smtp.something.com',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpmode' => 'smtp',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'email@email.com',
  'mail_smtppassword' => 'SuperSecurePassword',
'mail_smtpstreamoptions' =>
  array (
    'ssl' =>
    array (
      'allow_self_signed' => true,
      'verify_peer' => false,
      'verify_peer_name' => false,
    ),
  ),
);

PHP Modules:

[PHP Modules]
apcu
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
FFI
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imagick
imap
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
random
readline
Reflection
session
shmop
SimpleXML
soap
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
xdebug
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Xdebug
Zend OPcache

Could you please advise?
Thanks

Hard to say without knowing your whole server setup from top to bottom.

I see you don’t have PHP FPM installed and there is no memory cache like APCu and / or Redis configured. Both can increase performance massively. However, that doesn’t explain the insanly high page load times of 10-30 minutes. So there must be something much more fundamental going wrong on your server.

What webserver are you using, and how did you configure it? Did you follow a specific tutorial?

I can recommend the tutorials of C. Rieger (German) or Learn Linux TV (a more basic setup)

Or if you want something that comes with all the bells and whistles right out of the box, have a look at: GitHub - nextcloud/all-in-one: Nextcloud AIO stands for Nextcloud All-in-One and provides easy deployment and maintenance with most features included in this one Nextcloud instance.

Hello,

I’m using apache2 and I configured it based on Nextcloud requirements.
Also, I had installed APCU but it got even slower with that.

I have tried 3 servers in different data centers and I get the same result. But browsing the internet I see many NextCloud users have the same issue. Maybe it is due to some security scanning or something else?

Thanks

Which data centers, and from where are you connecting?

But honestly, I doubt that this has anything to do with the issue. Even the smalles VPS (Right now I have a test instance running with 2 cores / 2GB) should have way faster page load times. For me it takes maybe 6-8 seconds to login on that particular instance.

Again, very unlikely, but maybe you’d like to tell us what particular company you are using…?

I’m have used Exoscale, Hetzner, and Hosttech for various things, and never ever expirienced something even close to what you are describing, not even on their smallest VPSs.

And honestly, also with other well-known VPS providers like Linode, Digital Ocean etc, I have never heard of such issues that were caused by the infrastructure of the hosting company.

I have tried on
Contabo.com and Ovh.ie ( Hosted in Poland with 500 Mbp/s )

In both, I have tried on VPS and Dedicated Servers.
I’m Connecting from my home in Latvia with a 1 GBp/s network speed.

Never used them. However Contabo hasn’t the best reputation, respectively there are rumours that they over-subscribe their servers a little bit to much ;-). But even if that would be true, I still think there must be another issue that has nothing to do with the VPS provider.

if you are still convinced that this is caused by your VPS provider, you should probably contact their customer support.

Or you could try your setup on a Hetzner or Exoscale VPS. You don’t need a subscription to do that, just an account. Their VPSs are charged per minute or per hour, so a short test for 1-2 hours shouldn’t cost you more than a few cents. If it is slow there too, then it’s probably your setup that causes the issue…

…or maybe your ISP, but I think that’s rather unlikely too.

Thank you I will try.

1 Like