Moodle get slow at internal network

Moodle get slow at internal network

Mohamed Gamal གིས-
Number of replies: 17

Moodle is very slow after installing it on an internal network and not on the Internet

When installed on the Internet, it takes approximately half a second to open the login page

But after installing it in the same way on the internal network, it takes about 20 seconds to open the same page.

For example, when opening a grade report, it takes five seconds online, but on the internal network it takes approximately 3 minutes

After checking, we found that there are many requests that go to Moodle but do not come and are canceled, which is why it takes so long

What can we do? Has anyone faced this problem before?

Is there anything we can modify in the site administration that will solve this problem or help solve it?

དཔྱ་སྙོམས་ཀྱི་སྐུགས་ཚུ།: -
In reply to Mohamed Gamal

Re: Moodle get slow at internal network

Howard Miller གིས-
Core developers གི་པར Documentation writers གི་པར Particularly helpful Moodlers གི་པར Peer reviewers གི་པར Plugin developers གི་པར
So you're saying that you have more than one installation of Moodle, one is slow, one is fast?

So what IS the difference between the two installations? Are they on exactly the same server; same specification; same server software?
In reply to Howard Miller

رد: Re: Moodle get slow at internal network

Mohamed Gamal གིས-

thank you for your reply

No, they are not on the same server

The slow version is available on the internal server

The express version is on an online server

By internal server, I mean that this copy of the program is not connected to the Internet at all, but rather to an internal network

The possibilities of this server are great because it must accommodate many people

But the reason for the slowness, we believe, is because of the requests that go to Moodle and do not find the Internet, so the site is slow to open and deal with it.

You can see the analyzes in the attachments

Is there a solution?

Attachment 2d45e673-6508-4b1a-91cf-4bd2b244d54e.jpg
In reply to Mohamed Gamal

Re: رد: Re: Moodle get slow at internal network

Howard Miller གིས-
Core developers གི་པར Documentation writers གི་པར Particularly helpful Moodlers གི་པར Peer reviewers གི་པར Plugin developers གི་པར
There's nothing in Moodle that requires access to the (public) internet. An entirely internal installation of Moodle should be the same speed as one installed in the "cloud" - all else being equal.

The first things to check when Moodle is slow is to run the performance report and then to check that caching is properly configured. Don't try to cache on relatively slow NFS storage (for example)
In reply to Howard Miller

Ri: Re: رد: Re: Moodle get slow at internal network

Sergio Rabellino གིས-
Particularly helpful Moodlers གི་པར Plugin developers གི་པར
It seems a  DNS resolution problem, either on the webserver, or into the database server which would like to resolve the hostname of each connection.
You can disable the usage of DNS by MySQL: https://dev.mysql.com/doc/refman/8.3/en/server-system-variables.html#sysvar_skip_name_resolve, but you should verify BEFORE that your authorizations are defined on IP and not on host names.
The same should be verified on the webserver, as the logs could be configured to do reverse resolve.
In reply to Mohamed Gamal

Re: Moodle get slow at internal network

Visvanath Ratnaweera གིས-
Particularly helpful Moodlers གི་པར Translators གི་པར
You answered your own question:
> very slow after installing it on an internal network and not on the Internet

So look for the differences related to the network. Some ideas:
- the authentication server is in the Internet
- site linked to other services like repositories outside the LAN
- embedded videos on the site home
- as already pointed out by Sergio services configured to resolve the IP addresses in some DNS which is outside the LAN

The browser developer tool Network might give some hints. Otherwise the deep dive would be record the network traffic, with tcpdump and the like.


In reply to Mohamed Gamal

Re: Moodle get slow at internal network

John Doe གིས-
Hi Mohamed, did you end up figuring out what the issue is? I'm curious as I'm considering installing moodle on an on-premise server and running it locally. Please let me know. Perhaps we can look into it together if you still haven't found a solution.
In reply to John Doe

Re: Moodle get slow at internal network

Howard Miller གིས-
Core developers གི་པར Documentation writers གི་པར Particularly helpful Moodlers གི་པར Peer reviewers གི་པར Plugin developers གི་པར
If you're "considering" installing Moodle, why are you expecting to have a problem? That's very "glass half empty" མིག་ཁྱབ་
In reply to Howard Miller

Re: Moodle get slow at internal network

John Doe གིས-
I'm in the research phase. But anyway, does it matter? I'd like to look into potential issues that may arise and try to mitigate them. In this case, I'm particularly curious as to what may have caused this issue.
In reply to John Doe

Re: Moodle get slow at internal network

Visvanath Ratnaweera གིས-
Particularly helpful Moodlers གི་པར Translators གི་པར
Hi

No point in talking to Mohamed. After asking the question on 17 April 2024 he has not returned to this site ever. Yes, it is not nice. The helpers take trouble in answering the question but there is nobody to listen. Ideally, "Once your problem is solved, reply to the thread, adding [Solved] to the subject line of your post and providing links to the documentation, discussion or tracker issue that helped you." Site policy > Provide feedback. In which case, you wouldn't have had to ask for details (and wait).

But I am curious. Out of the thousands and thousands issues that have been reported on this site, how did you come to the conclusion that this one may hit you? Or are you generally worried that the "performance" of your Moodle will be insufficient? I am familiar with plan of your project, Server Mirroring Question. If you expect large classes to work synchronously, then you should mention that in the original thread.
In reply to Visvanath Ratnaweera

Re: Moodle get slow at internal network

John Doe གིས-
Hey Visvanath! Hope you are well.


> The helpers take trouble in answering the question but there is nobody to listen
Yeah I agree. I want to note that the team and I have looked at your (and Ken's) detailed response - which we are very thankful for - and will certainly return to the discussion with an update soon.

That being said, I randomly saw this post and simply out of curiosity I just wanted to know the reason for the issue described by Mohamed (That's the primary reason). The other reason is that I also thought that maybe we can mitigate this issue when we decide to follow through with our solution since it would be a big slap in the face if it turns out that the local Moodle running on the on-premise is a lot slower than our 'cloud' server.

But primarily, it's just curiosity. In any case, I'll update my thread once I have more info and will close it once our research/issue is concluded.
Have a great day!
In reply to John Doe

Re: Moodle get slow at internal network

Visvanath Ratnaweera གིས-
Particularly helpful Moodlers གི་པར Translators གི་པར
Rereading the original post I see that it resembles the setup you are planning, both are about running two Moodle instances in two networks.

That being common there are zillion other things that may not be common. In fact the OP gave a definite clue to his problem: "After checking, we found that there are many requests that go to Moodle but do not come and are canceled, which is why it takes so long". I bet the slowness in one was caused by its network setup: DNS, network filters (firewalls), proxies, forward or reverse, load balancing, SSL loads unloaded between proxies, etc. Your case is about a isolated (independent of the Internet) LAN at a school. I imagine it will be one single wireless network. So avoid the networking backflips counted above and you'll be safe.

Don't feel under pressure to follow up on your thread. There was a flood of information in it. Better try things out and then come back with specific problems. Also note that in my last post I turned the table around: Draw a plan, try it out "in mind" with the community. If the plan passes that test, you can implement it with a high level of certainty.
In reply to John Doe

Re: Moodle get slow at internal network

Ken Task གིས-
Particularly helpful Moodlers གི་པར

@John ... you are not on the same network, are you?  Your upstream provider isn't the same is it?

One cannot compare issues nor anticipate issues if not on the same network/upstream provider.

If your moodle is installed with git, have to have access to moodle's git repo.  Internally, in moodle code, h5p is a module that does 'phone home' to acquire it's submodules.   There are other addons which have 'dependencies'.  And to update/upgrade plugins, one would need to get to moodle's plugins site or the developers git repo.

'SoS', Ken

In reply to John Doe

Re: Moodle get slow at internal network

Howard Miller གིས-
Core developers གི་པར Documentation writers གི་པར Particularly helpful Moodlers གི་པར Peer reviewers གི་པར Plugin developers གི་པར
There are an awful lot of Moodle users out there and I think we can reasonably suppose that that majority of them run Moodle without trouble.

It just struck me as unusual to go "looking for problems". I've seen this before - several times - it's quite easy to "research" yourself into total inaction. I'm quite good at it myself འཛུམ་དྲག་
In reply to John Doe

Re: Moodle get slow at internal network

Visvanath Ratnaweera གིས-
Particularly helpful Moodlers གི་པར Translators གི་པར
@John

Talking of potential issues I see that you have an open issue: Database issue related to context table. Need troubleshooting help. Or, have you found the cause?
In reply to Visvanath Ratnaweera

Re: Moodle get slow at internal network

John Doe གིས-
Hey Visvanath, no that issue was resolved (mentioned it in one of the comments when replying to Leon). Thanks for checking! I appreciate it.
In reply to John Doe

Re: Moodle get slow at internal network

Visvanath Ratnaweera གིས-
Particularly helpful Moodlers གི་པར Translators གི་པར
I saw that you resolved the problem by adding a missing line to the database, that for contextlevel 10. I thought _why_ that happened, a cause at a lower level, was not found. 

But if you are happy with the solution and nothing happened since then, prefer you close the thread "manually" as explained in the Site policy > Provide feedback, "Once your problem is solved, reply to the thread, adding [Solved] to the subject line of your post and providing links to the documentation, discussion or tracker issue that helped you."