3.10.1 login page slow to load

3.10.1 login page slow to load

by Garth Brady -
Number of replies: 7
I have moodle on a test server (I'm the only one on it) and I'm seeing very slow times (~60sec) for the login page to load (I don't mean logging in, I just mean to get the login page to materialize).  Once in to the site, it's much snappier but sometimes I get debug info relating to the user's table (again, no users - just me)...  

Default Boost theme, Php 7.3/4 (dosen't seem to make a difference).  APCu, opcache enabled...

Can someone suggest something for me?  I don't get why the login page would take forever to load.  I've installed the VPL plugin along with Level Up! but that's it.  No query errors other than the user-related one I mention above.
Average of ratings: Useful (1)
In reply to Garth Brady

Re: 3.10.1 login page slow to load

by Ken Task -
Picture of Particularly helpful Moodlers

Might not be the issue, but APCu is a user PHP cache/accelerator which isn't required to run a Moodle.    The typical Moodle install requires/recommends Zend OpCache now, so suggest disabling/unloading that PHP extension, restart your web service, then use the cli script for purging the cache moodle has in admin/cli/

'SoS', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: 3.10.1 login page slow to load

by Garth Brady -
Thanks, Ken. I have been playing with that php extension and wondering if it's the culprit. Difficult to diagnose... I have a test install on the same server and seeing the same issue. I'll report back if I learn anything.
Average of ratings: Useful (1)
In reply to Garth Brady

Re: 3.10.1 login page slow to load

by Ken Task -
Picture of Particularly helpful Moodlers

Another instance on same server running under same PHP and PHP config?

You've not mentioned other ... but do you have anything that is a WAF (web application firewall) ... like mod_security or other similar?

'SoS', Ken

Average of ratings: Useful (1)
In reply to Garth Brady

Re: 3.10.1 login page slow to load

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

To me, 60 seconds suggests a timeout is expiring. For example something configured to call to something via a network connection, but it doesn't hear back from the remote end so after 60s it gives up and continues.

Some things to check: if there are any additional plugins installed? If there are any non-standard authentication methods enabled? if using an additional theme is this configured to do something special for login?

Your browser's developer tools may be able to help (for example: Network Monitor in Firefox) by showing if it's the resource /login/index.php that's taking 60s or something else.

On a CentOS 8 server with 2 GB RAM with no other load I'd expect the login page to load within 2 seconds, with no OPcache, maybe 5 seconds.

If you do see debug info please share it, it may be relevant.

Average of ratings: Useful (1)
In reply to Leon Stringer

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: 3.10.1 login page slow to load

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Suggestions:

Some things to check: if there are any additional plugins installed? If there are any non-standard authentication methods enabled?

Basically check if either 1) there's an authentication plugin that's timing out, or 2) there's an enrolment plugin that's timing out. The authentication plugins are tried in the order in which they appear in the Manage authentication page. Some authentication plugins may try multiple servers, e.g. auth_ldap can try multiple servers, and one server may be unavailable but the connection attempt may need to time out before the next is tried.

On successful authentication any enabled enrolment plugins will enrol the user as needed. If one of these is attempting to connect to an unresponsive server, e.g. enrol_database, then this may have to time out before the login process completes.

Average of ratings: Useful (2)
In reply to Leon Stringer

Re: 3.10.1 login page slow to load

by Junior Saraiva -

Hello everybody,

Great tips Leon Stringer.
I had the same problem reported here and following your tips I verified that there was an LDAP Enrollment Method (enrolsettingsldap) that was active and configured incorrectly (that is, without use), but because it was enabled it made Moodle check in all logins.

Thanks for sharing.

Average of ratings: Useful (1)