Hi Everyone! Moodle is an open source CMS that is widely used to create online learning media. You can create online classes, online courses or online tests using Moodle. Due to the large amount of resources required on the server, the use of Moodle on Hosting is limited. Installing Moodle on Hosting can only be done on a Business Hosting Package and its maximum users are only 30 people. Now one thing that makes Moodle's performance heavy is the possibility that the website cache is not properly managed. For that, you must enable Memcached on Moodle. What is Memcached for on Moodle? How do I set up Memcached in Moodle? Come on, follow the following guidelines.
Memcached on Moodle: For Better Cache Management
What is Memcached for? Memcached stands for Memory Object Caching System . One technology to speed up dynamic web applications is by storing and distributing data into server memory (RAM) so that the database load becomes light and website loading is faster.
Before following the step by step how to set up Memcached in Moodle, you have to enable Memcached first. How to? Please login to cPanel Hosting then look for the "Memcached" menu. By default, Memcached is active. Make sure Memcached looks like the following image. If not yet active, please click Start
.
Also Read: Complete Guide to Activating Memcached on Hosting
How to Set Memcached in Moodle
Moodle already has a Memcached plugin that can be used. Here's step by step how to set up Memcached in Moodle,
1. Memcached Must Be Active
The first step you have to do is make sure Memcached is active. And please take note of the memcached.sock file path / directory. In addition, make sure you are using PHP version 7.4. To change PHP version in cPanel, please follow the Guide on How to Change PHP Version in cPanel .
2. Login Moodle
Please open a Moodle-based online class and enter your username and password. Then click Log in
.
Like WordPress, Moodle also has plugins with each function. Please click Dashboard
then select Site administration
and click Plugins
.
Then in the section Caching
, please click Memcached
.
4. Enter the memcached.sock directory
In the first step, when enabling Memcached, you will find the memcached.sock directory. For example: /home/websites/memcached.sock
. Now in this section you have to write down the memcached.sock file directory as follows:/home/websites/memcached.sock:0
Then click Save Changes
. If you are successful in saving the path / directory of memcached.sock, the following image will appear.
Note: The memcached.sock directory on each hosting is different, please adjust it!
5. Configure Memcached in Moodle
Then it's time to configure Memcached. Click Menu Caching
and select Configuration
.
In the section Memcached
please click Add instance
.
Then fill in the form that appears. Please customize it with the memcached.sock directory on your Hosting.
Store name: please fill in memcached_store
Locking: leave the default
Servers: / home / websites / memcached.sock: 0 (adjust to the 4th step)
Use compression: Yes
Use serializer: leave the default only
Prefix key: memcache_
Then click Save Changes
. If successful, the following display will appear.
6. Perform a Memcached Performance Test on Moodle
Please click Caching
and click Test performance
.
Try checking the Memcached section. If it's already running, it means that Memcached is successfully active on Moodle.
7. Check Moodle Loading Time
You can also check the loading times for online classes based on Moodle. How fast is it when it is accessed? How is the performance of the database? and so on using the https://moodle.org/plugins/report_benchmark plugin . Then the benchmark results will appear from your Moodle.
Conclusion
Memcached is one of the Open Source software which is effective in cache management. Especially in using Moodle on Hosting. Cache management is very important. But keep in mind that the use of Moodle on Hosting is very limited. If an online class / online test based on Moodle interferes with other hosting users, we will take action. To be more secure, you can install Moodle on a VPS . The way Memcached settings on Moodle VPS is almost the same as the settings on Hosting.