Initial moodle setup

Initial moodle setup

by Tim David -
Number of replies: 8

How to set up moodle initially on the basis of RAM and vCPUs, what configuration tune ups are required to for a moodle website. 

The documentation https://docs.moodle.org/401/en/Performance_recommendations#:~:text=Moodle%20can%20be%20made%20to,%2Dbased%20database%2Ddriven%20system seems old. 

Requirment for my moodle is pretty basic, how should I tune up LEMP configurations for my intital moodle setup. I am unable to find adequate resources.

Average of ratings: -
In reply to Tim David

Re: Initial moodle setup

by Ken Task -
Picture of Particularly helpful Moodlers

You probably won't find this response to your liking and not very specific info because of this:

"Requirment for my moodle is pretty basic"

What's 'pretty basic' mean?  How many users/participants in how many courses using what modules and how using those modules?

And, looks like you've already decided some things ... LEMP ... as opposed to LAMP.

We know L is Linux, but what distro?  Hope long term support version ... and distro that is server class ... not a workstation/desktop.  Can tell you that 'shared hosting' may not provide enough resources and a VPS (unmanaged) might be too much ...  or setup like a reseller (WHM/cPanel (cost wise).

So generic: host where one has

Terminal access - command line.  Initial install of Moodle via git is by far the best way to install and maintain let alone update and upgrade.

Can attach a removeable data device (size of your choosing) that is also easily expandable - ie, 100 Gig to 1 TB.

Can expand memory ... wouldn't start a moodle with less than 8 Gig to begin ... and can expand to 16 Gig or 32 Gig. easily.

Additional software - ability to install ... MySQLTuner for DB tuning which will probably accure fairly quickly once site is used.   Other ... kinda up to you as you see the need.  Logwatch?   Mod_security/mod_evasive/ Securi/ClouldFlare?  SMTP server local or using a transactional service (like SendGrid)?

Is that enough for starters?   Am sure others will add to or have other info for ya ... even hard core CPU stuff! smile

'SoS', Ken



In reply to Ken Task

Re: Initial moodle setup

by Tim David -
Hi ken,
Here Linux distro means the Server would be of Rocky or Amazon Linux . The specifications are not for a VPS . I want to install moodle on separate servers according to User basis, Users might be 100, 200 or 500 . So, in general , I might be using instances of
vCPUs RAM (GiB)
1 1
2 8
4 16
8 32
16 64
Yes. I have decided that , I will use nginx instead of Apache but I am unable to find the settings to tune of Nginx, MySQL and PHP for the initial moodle site setup.
There will be terminal access only, I don't want to attach any removable data device .
In reply to Tim David

Re: Initial moodle setup

by Ken Task -
Picture of Particularly helpful Moodlers

Me thinks you are still kinda un-sure about your 'plan' ... so that only begets more comments and questions ... which are really food for thought for you ... otherwise, am 'consulting' ... and for free?

Rocky is a distro - a replacement for CentOS and upon which one could run the web service + the DB server + provide the storage (moodledata).  Could be hosted on Rackspace, Digital Ocean, Inmotion Hosting, TMD, ... any number of service providers.  An all-in-one server.

which is different than ...

Amazon Linux 2 (AL2) is the current Amazon Linux release that is Generally Available. AL2 supports the latest Amazon EC2 instance capabilities and is tuned for optimal performance on AWS. It comes with kernel live patching functionality to enable you to patch security vulnerabilities without rebooting your instance.
That could involve a dedicated DB server and another service for storage
.

A little leg work for ya ...
https://docs.moodle.org/401/en/Nginx

"I might be using" and "moodle on separate servers according to User basis, Users might be 100, 200 or 500".

So for the first, how does one give advice for 'might be'?
and the second ... 100 users could require more than 500 users depending upon
many factors - one of which - sync or async - participants and instructors/teachers/trainers in a F-2-F classroom or no F-2-F.

"specifications are not for a VPS" - huh?  Do you mean you are gonna be a quasi-moodle provider with a WHM/cPanel setup - reseller?

"tune of Nginx, MySQL and PHP for the initial moodle site setup."
That's because initlal settings are.a starting point and will be tweaked
(always upwards in most cases) based upon usage - which doesn't equate
to the number of users but *usage*.

"I don't want to attach any removable data device"
What we want and what we need are not the same.
I find removable data devices, that can be attached to any server (actually multiple servers on different networks) to be extremely useful for site backups and for course backups.

Another example: MySQL defaults - limit of 151 connections is just fine for 100 users but not for 500.

PHP - defaults for max upload file size - might work for a small site where most of the content is remote - but after a while OP (you) decides to attempt videos/audios from the Moodle server itself.   As courses get larger, backups of those courses requires
max_allowed_packets to be larger than defaults.

As courses get larger, backups take longer, thus tweaks to php settings related to time for a script to run, max memory a script can consume, etc.

And so on and so forth.

Now we could go back and forth until you are satisfied - but then I'd have to bill you for 'consulting' (that's what I am doing!) smile   Moodle is a DIY (do it yourself) project. smile

'Spirit of Sharing' (SoS), Ken


In reply to Ken Task

Re: Initial moodle setup

by Tim David -
Thanks, ken. For your generous reply.
Is there any way that I can allocate certain amount of memory from physical RAM to nginx, mysql and php .
There is a provision to adjust php memory limit but I am unable to understand that will it be affecting my RAM as whole or per process basis and also how can I preserve certain memory from my RAM to Apache , database and php , if there are 15,30 concurrent users doing quiz at the same time?
I know moodle allows 1GB of RAM for 10-20 concurrent users butt I am not able to club memory location with all other services in LAMP stack. 
In reply to Tim David

Re: Initial moodle setup

by Ken Task -
Picture of Particularly helpful Moodlers

This ... "moodle allows 1GB of RAM for 10-20 concurrent users" was a 'ball-park' of what moodle would use - 'concurrent' really refers to the DB not your web service.   So it's a balancing act between web services (in your case NginX) and DB which is MySQL/MariaDB?

Install MySQLTuner - a perl script - command line only - and run it with superuser creds.   That looks a config and 'usage' - shows current settings - then makes recommendations at the very end of the report - which you don't have to apply.

Now remember, tweaks/settings for a moodle is based upon actual usage - which is better than 'guestimations'.

https://github.com/major/MySQLTuner-perl

Here's a Linode article on it ... not recommending Linode hosting ... just referring to something so you get an idea of what MySQLTuner does.

https://www.linode.com/docs/guides/how-to-optimize-mysql-performance-using-mysqltuner/

'SoS', Ken



In reply to Ken Task

Re: Initial moodle setup

by Tim David -
Thanks ken for the resources, So basically I am a tuition teacher and I teach 15-20 students , I have to take quiz , for all of them , I researched a bit and I could use my AWS free tier account for having a t2 micro instance of 1GB memory , I want to install Moodle- 4.1 (LTS) . The OS (which is Amzn Linux 2) takes up 20% of my total RAM , there is remaining 800MB available RAM to run NGINX, MySQL and php-fpm 7.4 . and from your answer above I got to know that I have to allocate more resources to my DB server. So, i want to know there is no consumption of RAM from Ngin and php side? If it is , then how can I allocate RAM to these services and how much? so I could use my server at it's full potential. Sorry , from my side if I am being repitative Also if 20 students click start the quiz button at same time how much concurrent requests they will be generating ? Thank, You are a great help to me .
In reply to Tim David

Re: Initial moodle setup

by Ken Task -
Picture of Particularly helpful Moodlers

I don't know how many times I have to repeat this ... maybe if I 'shout' and put in bold?   BASED ON USAGE! smile

Here's what I would suggest you do ... Amazon a good choice.  As long as there is a path/way to: increase memory, increase space to be used as your site needs it.

Choose whatever Linux based setup/package you desire, install a moodle on it.

Start with the smallest - memory wise, space wise.

Think you'd be able to visually determine if that choice would suffice ... assuming you can install moodle and get it to run ... just logging into the moodle as admin.  I don't know if you have ever in your life experience dialup days and the 'world wide wait' .... but underpowered would look like 'world wide wait'.

Install just one plugin ... BenchMark

https://moodle.org/plugins/report_benchmark

Run it.   You don't have to share back here and ask questions about what stuff means ... 

Then take a deep dive ...

In moodle one can setup JMeter testing ... look for it in the Site Admin Menus Development.

https://docs.moodle.org/dev/Load_testing_Moodle_with_JMeter

Then you can do all sorts of testing senarios ... 20 users 'sneeze at same time' during a BBB lecture ... (yes, I know - sarcastic, but ....), results of a JMeter test will / should tell ya!

Do also study up ... on nginx config - php-fmp config.  Find links for those on your own!   Also study up on DB server config.

Oh, lookie here .. a quick and dirty Google Search for Amazon Tutorials found

https://aws.amazon.com/getting-started/hands-on/?getting-started-all.sort-by=item.additionalFields.content-latest-publish-date&getting-started-all.sort-order=desc&awsf.getting-started-category=*all&awsf.getting-started-level=*all&awsf.getting-started-content-type=*all

That certainly looks like you need no advice from anyone about your Moodle setup! smile

'SoS', Ken


Average of ratings: Useful (1)
In reply to Tim David

Re: Initial moodle setup

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

I don't know anything about the "cloud" operating systems. But by definition, "An operating system (OS) is system software that manages computer hardware and software resources, and provides common services for computer programs." https://en.wikipedia.org/wiki/Operating_system

Which means, it is not you, the system administrator, who allocates RAM and other things to individual programs like the web server, the database server. The operating system handles that. Well, unless you are a researcher on a revolutionary operating system. But on such topics the moodle.org is a dead-end.

If I take you by word, "I am a tuition teacher and I teach 15-20 students, I have to take quiz, for all of them", what is the cost of trying it out? The MoodleBox http://moodlebox.net/ runs on a 512 MB Raspberry Pi 3 A+. So, others have done it. Well, not on the "cloud", but RPi 3A+ is an embedded controller, not a proper server.

You said, "I could use my AWS free tier account for having a t2 micro instance of 1GB memory". So there is no monitory cost. Yes, the time costs. And for an accurate calculation you need to include the time of the "free" helpers here.
;)