Moodle is one of the most popular open-source learning management platform empowering educators and researchers across the world to disseminate their work efficiently. It is also one of the most mature and robust OSS applications that the community has developed and improvised over the years. We have seen customers from small, medium, and large enterprises to schools, public sector, and government organizations deploying Moodle in Azure. In this blog post, I’ll share some best practices and tips for deploying Moodle on Azure based on our experiences working with several of our customers.
Note: Versions 3.09 and 3.11 are currently supported, and we are working on support for version 4.0.
Prerequisites
Before you deploy, customize, and consume this solution, be sure that you have solid understanding of Azure Resource Manager (ARM) templates.
Provisioning a Scalable Moodle Cluster on Azure
To simplify the deployment and provisioning of a Moodle Cluster on Azure, our engineering team has developed some canned Azure Resource Manager (ARM) templates and that are available in our GitHub repository.
If you have Azure account, you can deploy Moodle via the Azure portal using the buttons in the table below, or you can deploy Moodle via the CLI. Please note that while you can use an Azure free account to get started, the template configuration you choose you may well require an upgrade to a paid account.
Below is a list of pre-defined deployment options based on typical deployment scenarios (i.e. dev/test, production etc.). All configurations are fixed, and you just need to pass your ssh public key to the template to log in to the deployed VMs. For production deployments, it is highly recommended to use the Large-size or Maximum template, which will provision high performance SKUs and configure the environment for high availability.
NOTE: The above deployment templates use hard-coded Azure Database for MySQL - Flexible Server SKUs for easier configuration and quicker deployment of Moodle workloads. If your deployment fails for any reason, please revert to the fully configurable template if possible, and change the Azure Database for MySQL - Flexible Server parameters accordingly.
Each version of the template deploys the following architecture in Azure.
Configuring Azure Database for MySQL for performance and scale
Moodle supports multiple databases such as MySQL, PostgreSQL, and SQL Server, but the best performance and scale for Moodle is observed with Azure Database for MySQL. As a result, MySQL is a preferred choice for customers and the community when deploying Moodle for large number (1K – 10K) of concurrent users. The deployment templates use Azure Database for MySQL - Flexible Server, a fully managed database service with features such as high availability, elastic scaling, and automatic backups. Leveraging a managed service ensures that you don’t have to worry about managing your database for backups and high availability or even setting up additional database monitoring.
When provisioning Azure Database for MySQL - Flexible Server for Moodle deployments, consider the information in the following table, which identifies the recommended tier for the best price to performance ratio based on your scenario.
Concurrent users |
Compute (vCores) |
Storage tier |
< 1K users |
8 vCores – General Purpose tier |
1TB |
1K – 2K users |
16 vCores – General Purpose tier |
2TB |
2K – 5K users |
32 vCores – General Purpose tier |
2TB |
> 5K users |
32 - 64 vCores – Business Critical tier |
2TB |
Azure Database for MySQL - Flexible Server supports a compute size from 1 vCore up to a maximum of 96 vCores, up to 16 TiB of storage, and up to 48000 IOPs at this time. You can independently tune instance and SKU sizing, storage sizing, and the IOPS configuration for your Moodle workloads to meet your end-user needs.
In addition to server scaling, server parameter configuration and other considerations are also important to ensuring the best performance of the Moodle application, as recommended in the official documentation.
The Moodle deployment templates shared in this blog post are not a managed solution. Moodle is a third-party software platform, and Microsoft Customer Support and Services (CSS) will not support the solution. Microsoft only provides support for the underlying infrastructure and the services used in the solution. The solution is open-source and maintained by the community of experts in GitHub, and for any issues, we recommend that you open an issue with GitHub.
Please see the Readme and detailed FAQs documentation before proceeding with deploying the solution in a production environment.
Yes, these templates are highly configurable. For full details about the configuration options, see the Moodle documentation (specifically, the Parameters documentation).
After deploying the Moodle template, you can find the Moodle Administrator password and other output parameters by using the following command.
MOODLE_DATABASE_ADMIN_PASSWORD="$(az group deployment show --resource-group $MOODLE_RG_NAME --name $MOODLE_DEPLOYMENT_NAME --out tsv --query *.outputs.databaseAdminPassword.value)"
To use the command, you’ll need to download and install the Azure CLI and provide your resource group and deployment name as the input parameters. You can find the name of your Moodle deployment by viewing the deployment history in Azure portal. For more details about viewing the deployment history, see View deployment history with Azure Resource Manager.
For more information, see Moodle/Get-Install-Data in the Azure/Moodle GitHub repository.
Get started by deploying your Moodle application on Azure using the provided templates. Then, if you have feedback or have any additional findings, just reach out to us at AskAzureDBforMySQL@service.microsoft.com, and we’ll be happy to incorporate it into our blog post.
Thank you!
Parikshit Savjani and Sai Kondapalli
Microsoft Azure Database for MySQL product group
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.