The document provides tips for improving Moodle site performance based on user roles. It suggests that teachers enable only necessary filters, resize images before uploading, and reduce sections/recent activity blocks. Moodle administrators should use performance reports, disable log legacy data, and reduce frontpage courses. System administrators can implement memcached, Opcache, compare session storage, and optimize hardware. Developers should reduce database queries in loops, join on indexes, and add caching. Moodle HQ ensures no regressions and looks for performance issues and more caches.
2. the world’s open source learning platform
Why my Moodle may be slow?
Because it needs
time to be as
awesome as it is.
https://commons.wikimedia.org/wiki/File:Florida_Box_Turtle_Digon3a.jpg
3. the world’s open source learning platform
What can you change if you are a...
1. Teacher Moodle course
2. Moodle administrator Moodle site
3. System administrator Servers
4. Developer Code
5. Moodle HQ Releases
4. the world’s open source learning platform
If you are a teacher try to...
● Enable just the filters you think are really necessary
● Resize your images before uploading them
● Reduce number of sections or paginate them
● Remove recent activity block
● Disable features you and your students do not use
● Ask your Moodle administrator :)
http://www.wallpapersnewhd.com/mario-wallpaper-hd-free-download/
5. the world’s open source learning platform
If you are a Moodle administrator...
● Performance overview report
6. the world’s open source learning platform
● Disable log legacy data
● Reduce number of courses on frontpage (or use Dashboard)
● Moodle features that might affect performance
○ Enabled filters
○ Event monitor
○ Grade history
● Use slash arguments (web cache)
● Ask your sys admin :)
If you are a Moodle administrator...
7. the world’s open source learning platform
If you are a system administrator...
● Memcached
○ For caches
○ For session data
● Opcache for opcode caching (PHP 5.5 onwards)
○ https://docs.moodle.org/29/en/OPcache
8. the world’s open source learning platform
If you are a system administrator...
Compare performance:
● Cache stores config
● Sessions to database, to
file, to memcached?
● Hardware, network
https://github.com/moodlehq/moodle-performance-comparison
9. the world’s open source learning platform
If you are a system administrator...
● Hardware, clusters, NAS, proxy caching, Apache & database tuning…
○ You know better than me, find other sysadmins and talk with them
○ https://docs.moodle.org/29/en/Performance_recommendations
?!¿?¡¿?
10. the world’s open source learning platform
If you are a developer...
● Database queries
○ Reduce db writes and db reads as much as possible
■ Avoid queries inside loops (design ready to fetch “IN ()”)
○ Always join using indexed fields
○ For big data set processing use get_recordset* + recordset_walk
○ Add cache definitions when necessary
● Code profiling
○ XHProf
● For global changes
○ moodle-performance-comparison
11. the world’s open source learning platform
If you are Moodle HQ...
● Ensure no performance regressions are introduced -> http://goo.gl/yp14bO
● Look for performance issues and more caches -> e.g. MDL-48448
● Expand performance test coverage (work in progress)
12. Questions or more information
Tracker
https://tracker.moodle.org
Hardware and performance forum
https://moodle.org/mod/forum/view.php?id=596
David Monllaó
davidm@moodle.com
the world’s open source learning platform