I need 30 seconds to login to nextcloud

Login speed is slow.
It’s a fixed time in any environment. Whether PC or Mac or iPhone (Wi-Fi / 4G), it is “30 - 32 seconds” in any environment.

I was able to login in a few seconds immediately after setting mysql.ini (/etc/php.d/mysql.ini) for the first time. However, it will be delayed again after about 1 hour elapses.

I will not improve even if I reboot the server. Where should I adjust and how?

Especially when I look at the log, no fatal error has occurred.
Warning
Scss is disabled for /var/www/vhosts/courio-city.net/nc/core/css/share.scss, ignoring
*For server logs, which should I see?


Nextcloud version (eg, 10.0.2): 12.0.0
Operating system and version (eg, Ubuntu 16.04): CentOS 7.3
Apache or nginx version (eg, Apache 2.4.25): nginx 1.11.10
PHP version (eg, 5.6): 7.1.7 (I see PHP 5.6.30 when I look at the control panel of PHPMyAdmin.)

the bruteforce protection? Can you check the processes running during these 30s?

1 Like

I thought that this problem was solved, but it recurred this morning. I thought that this problem was solved, but it recurred this morning. From the previous experience, I may resolve it naturally if time passes.

My setting of MySQL seems not to solve the problem this time. I saw the server error log, but at least there is no error log of today.
In addition to that, “internal server error” has occurred today. It takes about 40 seconds to log in and an internal error occurs. There is no error number. An internal error occurs only when the login is successful.

Internal Server Error
The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

There seems to be no error in the server’s log, but when I look at the log of Nextcloud it seems there are some errors.

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing ‘SELECT id, numeric_id, available, last_checked FROM oc_storages WHERE id IN (?)’ with params [“local::/var/www/vhosts/NEXTCLOUD/data/”]: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing ‘SELECT uid, password FROM oc_users WHERE LOWER(uid) = LOWER(?)’ with params [“USERNAME”]: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing ‘SELECT id, uid, login_name, password, name, type, remember, token, last_activity, last_check, scope FROM oc_authtoken WHERE token = ?’ with params [“f2a65a6da20e5863f62936d6b6b52dc309cb7855f3bd2186052ec5b91c6a66cdaa7e5ffdcc93c3c2f7f8be5b478e5c0a2ad25a2d82d699c23066d05a80a4db79”]: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

*There are cases of errors and fatal cases.

There is no error in MariaDB’s log.

What I have in common with the last time, I will not improve even if I reboot the server. MariaDB, nginx, PHP-FPM, these restarts are also ineffective.

When restoring to the original my.cnf that was backed up at that time, no internal server error seems to occur. Login takes time, but no internal error occurs. Is MySQL the cause of the problem?

Unfortunately, I don’t seem to be able to hope for a solution over time.
Adjusting max_allowed_packet and wait_timeout has no effect at all.

Apparently the problem seems to be only “login”. I sometimes accidentally log in. Once I can log in, there seems to be no problem with the operation after that. When I log out, I can’t log in after that.

I have not added Bruteforce in the app store. Is there any other setting for Bruteforce?

I have not been able to solve it yet.
I found that when MySQL data is returned to its initial state* it will recover.
initial state:
I install nextcloud, make the initial setting of nextcloud, and make it for each user. Back up MariaDB data at this point.

Then, each user creates a folder and sets sharing settings for that folder. Each user completes the setting and logs out. Later login is later. The waiting time is fixed 30-32 seconds. What is this 30 seconds?
This fixed time is very strange. It seems to be setting something. It takes 30 seconds for something to be done and it seems like waiting for it to finish.

First create an account and log in after hours. Log out without doing anything. Log in again. Log out again. Then log in with time. At these times, login speed is fast. In other words, it seems not to be slowing down by time. Slow down by setting something.
The number of users is about 15 people, but it seems that the login speed will be slower when about half the setting is over. There was no error in nextcloud at this time.

I will not improve even if I disable all nextcloud’s applications. Even if sharing is also disabled, it does not improve. I saw a slow query on MySQL, but I can not find a slow query. It’s all about 0.0003 seconds. In this way I have become uncertain whether MySQL has problems or whether there is a problem with setting nextcloud.

How can I solve this slow login problem?

Oh! I found it.:rofl::relaxed:
Thank you.

I added the following to config.php.
'auth.bruteforce.protection.enabled' => false,

Once I set this up I can log in in seconds. I did not know the existence of this setting.
But it is not safe to completely disable Bruteforce. Is it possible to adjust that time?

Hi my friend, I have a problem alike as you. When I connect cellphone app by local network does not work and web interface will be does very slow when log in… like 30 seconds, but when I am in another network “remote network” work perfectly. I was reading some solutions like “auth.bruteforce.protection.enabled”. Do you think would be a solution? You only add the line in config.php? that´s all?
Thank you for your help. :slightly_smiling_face:

Thanks. My instance had been logging in without delay. Then suddenly today it started taking up to 40 seconds.

Cheers.

Same for me, I get 524 timeout when I try to log-in as admin. No errors. Other users can log-in…
See: Impossible to log-in the admin : 524 timeout