I've been running a Moodle 3.4 server since January in a shared hosting account at TMDHosting, which nominally supports Moodle. I have only 16 students in my single course, and I'm only using a few additional plug-ins (mod_attendance, qtype_gapfill, atto_htmlplus, and atto_styles). Today, my students and I have been getting locked out of the site due to surpassing our hosting limits. Among other things, I'm hitting the physical memory limit of 1 GB:
As the graphs show, database faults (cyan in the bottom graph) are co-occurring with maxing out physical memory (in the middle graph). I don't know if the faults are causing memory to max out or vice versa. The first cyan spike suggests that db faults are happening in the absence of physical memory problems.
I don't see anywhere in cPanel or Moodle where I can get more information on the db faults. In my Moodle environment page, everything is okay except:
I never fixed these because it wasn't a priority and I don't have command-line access. Do you think these warnings could cause the db faults?
The helpful tech support people at TMDHosting said these are the limits I've hit in the past 24 hours:
You have reached entry processes (number of simultaneously running php and cgi scripts, as well as cron jobs and shell sessions) limit 204 times
I/O usage resources were limited for your site
Your Physical Memory usage was at 1023.94 out of 1024
Any advice on how to diagnose or fix my problem? I'm knowledgeable about computers (CS professor) but not a Moodle hacker or sysadmin.
This is a common question here. The most likely answer is: Your (shared) host is insufficient to run Moodle, which is also backed by the answer of their support team. It is not worth wasting time with cheap mass packages. Go for a VPS.
It is still interesting to know when this peak happened. It is some 6+ hours before you took that graph. Did you run a class at that time? Or some timed job (cron) like automatic course backups started at that time?
I assume that the shared server environment cleanly isolate you from other loads. Also, since the hoster (or their script) installed Moodle and it was running until now, there are no faults in the installation. A rare possibility is a corrupted database. The hoster might be able to check that.
Thanks very much for the replies. I'd be happy to pay $25/month (especially because there's less than 2 months left) if I knew who to pay. The hosting options discussion link in the FAQ posts to a discussion from 2008, which I doubt is still relevant. At Moodle Partners, I'd be in the "let's talk" pricing range because I rely on a respectable but not common plugin, gapfill.
I know we're not supposed to ask for hosting recommendations here, but can anyone take pity on a stressed professor who has desperate students and needs to get her site back up again? You can even email a referral link offline at firstname.lastname@example.org if you prefer that to posting. I looked at a general review of VPS hosts, and it recommended TMDHosting, so I don't trust it.
You haven't given enough background information to suggest a solution. You haven't seen the "Read this first!" of this forum, https://moodle.org/mod/forum/post.php?forum=94, I believe.
[I know, it appears only when you start a new discussion, then disappears. It is a sorcery specific to moodle.org.
Can't help with the outdated documentation either. Another moodle.org speciality. )
Therefore I make some assumptions below, pl. correct me if I am wrong.
- You looked for a hosting plan couple of years ago, https://moodle.org/mod/forum/discuss.php?d=316993#p1270593, in the General help forum! And we see where TMD TMDHosting come from.
- You haven't said that you plan to conduct on-line examinations. But you started immediately, https://moodle.org/mod/forum/discuss.php?d=316966#p1270416. (It is a wonder, your server lasted so long!)
- You conduct on-line exams in a classroom.
- Now to the incident:
-- It happened during an on-line exam.
-- The server froze and the exam results are lost.
That is what I meant by "It is not worth wasting time with cheap mass packages". Even if you recovered the data, the disturbance, your wasted time, are they worth the USD 20 per month you save?
To the "solution", VPS. There is a catch. Unlike shared hosting, VPS are empty except for the OS. For the routined system administrator no big deal to get the LAMP stack up for Moodle. But it is no one-time job, you have to maintain the server. That is where the "managed servers" come in, in a much higher price range than the USD 25 per month. "Managed server" does not necessarily mean, the hoster has experience with Moodle. For this reason, there is another class of hosters, who specialize in Moodle. Moodle Partners are the leaders in this, and do contribute their earnings to the further development of Moodle.
As told at the beginning, I am not suggesting any solutions. First go through the points made and pl. correct or amend what I have overseen. Also try to answer the questions raised. For example, you haven't said anything on "Did you run a class at that time? Or some timed job (cron) like automatic course backups started at that time?" in my previous post.
I can vouch for InMotion Hosting. I use their VPS-1000 package for $500/yr (half that for your 1st year). We have about 300 students with up to 50 simultaneous users online doing courses and quizzes. Never had a problem.
A few comments:
- I opted for the Softaculous Package installer ($50/yr) as it is so easy for noobies to install Moodle. It offers a host of other packages also if you're interested. If you're not technically inclined it makes for an easy install. It also has 1-click version upgrades with full backup if something goes wrong. It also makes it easy to setup a demo or sandbox site to test out plugins or ideas without the risk of blowing up your main site. I was hesitant at first but I've used it for a couple of version upgrades with no issue.
- It comes with a full cPanel package with File Manager, SQL tools, PHP Manager, etc to help you manage your site
- You can get root access at no charge although you do have to explicitly request it. I don't recommend you attempt it unless you're familiar with the Linux command line.
- Their customer and technical support is excellent, timely and they've got me out of a few self-induced disasters. They offer online chat support too.
Now I know some of you will point out all the issues with Softaculous not doing the best install but it has worked well for me for over 2 years.
just my 3 cents worth (inflation happens!)
I'm going to point out the fairly steady stream of "my Moodle won't upgrade" help requests we get here related to Softaculous and its ilk. My point has always been that Moodle is pretty easy to install without one of these iffy installers. The big thing is that if you install it following the recommended instructions then you know what you did and we can give you lots of help if it goes wrong.
If I use Softaculous, I go to the Scripts Installations screen and click on the arrow circle to the right. The scripts upgrades the Moodle version but I still have to use the cPanel File Manager to copy the missing plugins to the updated site. InMotion doesn't do the upgrade, Softaculous scripts do the work.
I have used this for both minor version (e.g 3.4.1 to 3.4.2) and major version (3.3.5 to 3.4.2) upgrades without any issues.
I am having some problems with my actual hosting, and I found this post in which you recommend the Inmotion VPS hosting.
I have very similar quantities of users (about 450 users, but during my classes, I can have 50 concurrent users) using my Moodle Instance. My problem is that with more than 25 concurrent users, my hosting fails and disconnect temporarily my site
After your recommendation, I am strongly considering moving my Moodle Instance to the Inmotion VPS hosting, but before I do that, I want to verify with you if you are still very happy with the service you are receiving from Inmotion Hosting, and still recommending it?
I really appreciate your help.
I have already contacted and talked to them. The VPS-1000 package seems to be exactly what I need.
Thank you so much!!
1GB isn't enough to run a live Moodle site - that's the short answer.
Although you can, in theory, get Moodle to run in even less than that you're going to struggle massively to run a live service with real users. Moodle is a huge application and on top of that it's competing with other stuff for the memory.
As Visvanath says, it's getting increasingly tricky to run Moodle on low-cost hosting.
To add to what the others have said, I have found that these low cost "unlimited xxx" hosted servers actually do have limitations. So you hit a limit with TDMHosting... what's the big deal? Well, the big deal is that there is some very "fine print" that basically says "we really don't mean unlimited."
I am not the database expert, but it could be that the two errors in the Moodle environment really are causing the problem because the database can do what it efficiently needs to do, and therefore tries and tries and tries, causing an overload.
Unfortunately, right now, the solution seems to be to move up to a VPS. TMDHosting has these, and maybe they can help. Yep, the cost will probably go from something like $5US/month up to $25US/month. With a VPS, one can usually solve the Moodle configuration problems.
Incidentally, some of these database issues don't have to do with having command line access (you actually should have this with TMDHosting if you demanded it), they have to do with the database engine running on their server, which they will not allow you to mess with.
I ran into this issue a while back and from what I can recall it was related to adding videos directly in Moodle rather than embedding a link to a video hosting site like Vimeo. The hosting package was the lowest version and as they say - you get what you pay for.
I switched hosting services (inmotionhosting.com) and now have a Moodle site running on a shared server at using their entry level Launch service for $6/mo and it runs fine with with 2GB of RAM. I also run a Moodle 3.4 site on their entry level VPS service and have no problem supporting 40 simultaneous users.
First, thank you for all of the kind and helpful replies. What a nice community! You've been especially gentle given that I only read some of the "Read this first!" (the Performance FAQ but not Performance). I'll try to pay forward the generosity, to my students and online.
Second, I decided to deal with my problem by throwing money and hardware at it, since I was desperate to get back up as quickly as possible. I upgraded to a different TMDHosting package for the remaining < 2 months of the semester. We'll see how it goes. I have a quiz today.
Third, to answer a question, the peak happened at 11 AM, which is when my class starts. I tried to take attendance -- my bad. Seriously, several students may have tried signing in simultaneously. This has happened without problem throughout the semester (which started in January). It's possible I might have uploaded a non-ASCII character in a new assignment, or something, but I didn't make major changes.
Fourth, I do not host videos (or other large files), as someone kindly pointed out could be a problem. I use links to Google Drive.
Fifth, in the future, I'll get an adequately resourced hosting package with command-line access. I have installed Moodle before (and like being able to tweak the code, although it makes upgrading a pain).
Thank you again.
What is the "non-ASCII character in a new assignment" you were talking about? It reminded me the discussion "Not able to delete a message - Moodle freeze" https://moodle.org/mod/forum/discuss.php?d=367808. So the students were doing an assignment durint class? How did it end up?
And, possibly one more joined your boat yesterday: "Moodle crashes after several students try to access or submit a questionnaire" https://moodle.org/mod/forum/discuss.php?d=368472.
BTW, how many students were in the class (connected to Moodle)? They've just logged in as you were taking attendance and that was enough to freeze the server? Or, did they try to fetch an on-line exam? If there was an on-line exam going on, what was the plan exactly? How many questions? Were all trying to fetch the exam the same minute?
There are 16 students in the class. There wasn't a quiz, but I told them there might be one, so I guess some were trying to log in just in case.
What is the "non-ASCII character in a new assignment" you were talking about?
It was just a wild guess of what could have been causing the database error. I was primed by reviewing my server settings and seeing that I had the "mysql_full_unicode_support" warning.
Thanks for the details.
So, just 16 students logging in overloaded the server? (I am assuming that your site is on Moodle internal authentication, no sophisticated methods (see https://docs.moodle.org/en/Authentication). Then the server is either very weak or something broken. Whichever, you need leave it ASAP.
Note that the infamous Database error could come if the database is not responsive because it is overloaded.
You mean, the Server environment check warns about mysql_full_unicode_support? It is just a warning; has nothing to do with server overloading.