Very slow login after updating to 21.0.3

Hello my dear!
Thank you very much!
Good week and good job to you too! :smiley:

1 Like

Good evening everyone,
sorry if I re-open this thread, but I still have the same problem: i have a small server with Apache2, mariadb, php7.4 Ubuntu 20.4.2 server and I just updated, via the stable channel, from 20.0.11 to 21.0.3, but it became very slow when I log in from browser and when I use Android apps , also from my pc with Ubuntu, I can’t access the folder, a window appears that says that the time out has been reached.
On settings, Nextcloud warns me about this:
A background process is pending that checks the SSL certificates imported by the user. Check back later.
but I have no idea what that means.
Can anyone help me please?
Thanks so much!!!

@mercurio do you use collabora server app ?

Hello,
and thank you for your attention!
No I don’t have it, as apps I only have: dashboard, files, photos, tasks, contacts, calendar and notes.
I have never installed memcache, because it never succeeded, but it never gave me problems in previous versions.

@mercurio have you enable opcache and php-fpm ?
https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html

those methods allows to cache php but it use more RAM ( not a lot)

Mhmm opcache yes, I’ve always configured it according to the documentation, but php-fpm I don’t know what it is … doce check? In the php config file?

Forgive me for the ignorance: if this were the problem, why with the previous versions of NC I never had difficulties?

@mercurio php-fpm is a module of PHP which allows more performance for PHP.

I don’t think this is the real problem but it can reduce the load of your pages.
Your CPU is overloaded or not? if not no need to install it.

maybe more info about your nextcloud server can help us. ( ram allocated for PHP, your CPU load, … maybe some logs about this but not sure if there are any.

Hi @Mageunic
and I’m sorry if I only answer you now!
So I managed to modify the php-fpm parameters, and now I put these:
pm = dynamic
pm.max_children = 120
pm.start_servers = 12
pm.min_spare_servers = 6
pm.max_spare_servers = 18
unfortunately it always remains slow …
For the other information you asked me, I can tell you this:

  • my cpu is AMD Athlon ™ II X2 260 Processor (2 cores) and it doesn’t seem overloaded;

  • PHP
    Version: 7.4.21
    Memory limit: 4 GB
    Maximum execution time: 3600
    Maximum upload size: 1.9 TB

  • Database
    Type: mysql
    Version: 10.3.29
    Size: 77.2 MB

Is this useful information?

Nobody can help me, please? :sob:
I know I’m not an expert, sorry and thanks for your patience!!! :bowing_man: :bowing_man: :bowing_man:
I managed to configure Redis, I configured php-fpm, I configured cron instead of ajax, in “settings” it tells me that all the checks are passed, the Nextcloud security scan gives me the result A, the ssllabs check. com gives me the result A +, so why is it slow?

HI @mercurio, sorry I can’t help you … check if someone else has already solved the issue on other topics.

It was happening to me after adding my SSL certificate.
The steps under “Allow access from nextcloud sync apps” fixed it for me:

1 Like

Hi @Mageunic ,
do not worry! Indeed, I thank you very much for the attention and help you have given me, really! :bowing_man: :blush: :beers:
I will try to do further research, also hoping for a resolution with the new updates.

Thanks so much @Jakob2799 ! :+1:
I’m leaving for a few days off, as soon as I get back I read it carefully!

Hey @mercurio

Your issue sound familiar to me .
we manage this problem with this command:
sudo -u www-data php /var/www/nextcloud/occ files:scan-app-data

1 Like

Good morning @Mageunic , @Jakob2799 and @freumichCH
forgive me for being in hiding! It was a part-and-come home time,
Thank you all three for the suggestions: since I managed to configure the memcache service, php-fpm and done as @Jakob2799 told me, the situation has definitely improved, even if it still isn’t very fast.
I will also try the command that @freumichCH freumichCH suggested to me, let’s see if it can help further.
Thanks again and have a nice day!!! :smiley:

3 Likes

I was having the same issue, but not on every users. Only my personal user was apparently impacted. I am using Nextcloud’s native authentication, no LDAP or OAuth integration.

Check if you are running in the same issue, run the following query:

SELECT uid, count(id) AS nbtokens FROM authtoken GROUP BY uid;

If a user has a high number in column nbtokens (> 100), login can take more time.

In my case I don’t bothered about reconnected some devices, I just deleted every tokens I had in this table.

DELETE FROM authtoken WHERE uid = 'myuser';

Don’t forget to replace “myuser” by your actual username;

1 Like

Hi,

I’ve had this 100+ login tokens issue that slows down my web logins and CalDAV logins (Improving the speed of my Nextcloud instance - #8 by Kalytis)

I’ve used @MelwinKfr 's solution, and it worked every time. Now, does anyone have an idea how to stop these login tokens from staking, please ?

Hello Kalytis,

I’m glad to see that my post helped someone.

For me the problem was coming from iOS devices caldav and cardav integration.
To fix it, I simply connect my devices using “app password”.

You can find this setting under https://your-nextcloud.com/index.php/settings/user/security.

1 Like

Thank you so much for the solution(s) and for your time !!

Hi,

same for me. I had nearly 1000 tokens for my user. Deleting the entries from authtoken was the solution. I was strugeling with my web login (which took 1min and 6 sec) for 2 days now. Thank you very much :slight_smile:

I am wondering, what gave you the hint to search in that table? I had no idea what causes that long login time. I enabled debugging in NC, PHP-FPM but found not even a small hint… Maybe I should have enabled MSSQL slow log / debug log?

Cheers,
Bender