Optimization of LMS for Improving User Response Time 24 June 2014 B.RAJU (123050091) Under the guidance of Prof. Deepak B. Phatak Dept. of Computer Science and Engineering IIT Bombay
Outline LMS Moodle Problem Statement Tools Design and Implementation Conclusion and Future work 24 June 2014 1 / 55
Part I Learning Management System
Learning Management System Comparison Figure: Comparison of LMS in traditional and e-learning[pw09] 24 June 2014 3 / 55
Learning Management System LMS functionalities Basic functionalities of LMS The following features[at10] are required for LMS in an e-learning process. Modular structure Discussion forums, group work Video conferencing support Online exam, exam module chat, wiki, survey, search, Whiteboard Backup support XML support to work with different systems Multiple language support.raju (123050091) Under the guidance of Prof. DeepakLMS B. Phatak Optimization (IIT Bombay) 24 June 2014 4 / 55
Learning Management System LMS functionalities Basic functionalities of LMS The following features[at10] are required for LMS in an e-learning process. Modular structure Discussion forums, group work Video conferencing support Online exam, exam module chat, wiki, survey, search, Whiteboard Backup support XML support to work with different systems Multiple language support.raju (123050091) Under the guidance of Prof. DeepakLMS B. Phatak Optimization (IIT Bombay) 24 June 2014 4 / 55
Learning Management System LMS functionalities Basic functionalities of LMS The following features[at10] are required for LMS in an e-learning process. Modular structure Discussion forums, group work Video conferencing support Online exam, exam module chat, wiki, survey, search, Whiteboard Backup support XML support to work with different systems Multiple language support.raju (123050091) Under the guidance of Prof. DeepakLMS B. Phatak Optimization (IIT Bombay) 24 June 2014 4 / 55
Learning Management System LMS functionalities Basic functionalities of LMS The following features[at10] are required for LMS in an e-learning process. Modular structure Discussion forums, group work Video conferencing support Online exam, exam module chat, wiki, survey, search, Whiteboard Backup support XML support to work with different systems Multiple language support.raju (123050091) Under the guidance of Prof. DeepakLMS B. Phatak Optimization (IIT Bombay) 24 June 2014 4 / 55
Learning Management System LMS functionalities Basic functionalities of LMS The following features[at10] are required for LMS in an e-learning process. Modular structure Discussion forums, group work Video conferencing support Online exam, exam module chat, wiki, survey, search, Whiteboard Backup support XML support to work with different systems Multiple language support.raju (123050091) Under the guidance of Prof. DeepakLMS B. Phatak Optimization (IIT Bombay) 24 June 2014 4 / 55
Learning Management System LMS functionalities Basic functionalities of LMS The following features[at10] are required for LMS in an e-learning process. Modular structure Discussion forums, group work Video conferencing support Online exam, exam module chat, wiki, survey, search, Whiteboard Backup support XML support to work with different systems Multiple language support.raju (123050091) Under the guidance of Prof. DeepakLMS B. Phatak Optimization (IIT Bombay) 24 June 2014 4 / 55
Learning Management System LMS functionalities Basic functionalities of LMS The following features[at10] are required for LMS in an e-learning process. Modular structure Discussion forums, group work Video conferencing support Online exam, exam module chat, wiki, survey, search, Whiteboard Backup support XML support to work with different systems Multiple language support.raju (123050091) Under the guidance of Prof. DeepakLMS B. Phatak Optimization (IIT Bombay) 24 June 2014 4 / 55
Learning Management System LMS functionalities Basic functionalities of LMS The following features[at10] are required for LMS in an e-learning process. Modular structure Discussion forums, group work Video conferencing support Online exam, exam module chat, wiki, survey, search, Whiteboard Backup support XML support to work with different systems Multiple language support.raju (123050091) Under the guidance of Prof. DeepakLMS B. Phatak Optimization (IIT Bombay) 24 June 2014 4 / 55
Types of LMS Learning Management System Open Source and Proprietary LMS LMS are available in proprietary as well as Open source[moo]. 1 Open Source LMS s are edx, Moodle, ATutor, SAKAI, WebCT, Dokeos, Claroline, and so on. 2 Commercial LMS s are Blackboard, Desire2Learn, ANGEL Learning Management Suite, KEWL, and ecollege[at10, BK12]..RAJU (123050091) Under the guidance of Prof. DeepakLMS B. Phatak Optimization (IIT Bombay) 24 June 2014 5 / 55
Types of LMS Learning Management System Open Source and Proprietary LMS LMS are available in proprietary as well as Open source[moo]. 1 Open Source LMS s are edx, Moodle, ATutor, SAKAI, WebCT, Dokeos, Claroline, and so on. 2 Commercial LMS s are Blackboard, Desire2Learn, ANGEL Learning Management Suite, KEWL, and ecollege[at10, BK12]..RAJU (123050091) Under the guidance of Prof. DeepakLMS B. Phatak Optimization (IIT Bombay) 24 June 2014 5 / 55
Part II Moodle LMS
Outline: Moodle LMS Introduction Standatd Moodle Functionalities Database 1 Server Architecture 2 Tables classification 24 June 2014 7 / 55
Moodle Introduction Introduction Moodle is used for primary and secondary schools, non-profit organizations, hospitals, private companies, libraries. Standard Moodle includes core Moodle modules and different types of plugins. Core of Moodle 1 Courses and Activities 2 Users 3 User functionalities 4 Logs and Statistics 5 Libraries 24 June 2014 8 / 55
Standard Moodle Functionalities Moodle Functionalities[moo] Assignment Submission Discussion Forums File Download Grading, Chat, Wiki, Online Calendar Online news and announcement (College and course level) Conducting online quiz Multi language support Modular, i.e., can be extended by creating plugins Report (Which can be used for tracing or analyzing the user logs) 24 June 2014 9 / 55
Developers Perspective Developer perspective 1 Entire Moodle LMS contains 1.488 Million Lines of Code 2 Organization of code follows transaction script approach 24 June 2014 10 / 55
Developers Perspective Developer perspective Figure: Technologies used in Moodle 24 June 2014 11 / 55
Server status Developer perspective 24 June 2014 12 / 55
Database locks Developer perspective 24 June 2014 13 / 55
Processlists Developer perspective 24 June 2014 14 / 55
Part III Problem statement
Problem statement Problem statement 1 Database locks are used in moodle 2 updates are done in moodle session database table 24 June 2014 16 / 55
Moodle database Moodle DB Moodle Database support MySQL, PostgreSQL, SQLite, and Oracle. In our case, we are using MySQL. Moodle database schema contains 314 tables. These tables is contain core database tables, and plugin tables. The Moodle database structure is defined in install.xml files inside the db folder in each plugin. Uses XML for updating Moodle database Moodle uses InnoDB storage engine as default one. Moodle 1.9 or earlier versions are using MYISAM storage engine.raju (123050091) Under the guidance of Prof. DeepakLMS B. Phatak Optimization (IIT Bombay) 24 June 2014 17 / 55
Moodle database Moodle DB Moodle Database support MySQL, PostgreSQL, SQLite, and Oracle. In our case, we are using MySQL. Moodle database schema contains 314 tables. These tables is contain core database tables, and plugin tables. The Moodle database structure is defined in install.xml files inside the db folder in each plugin. Uses XML for updating Moodle database Moodle uses InnoDB storage engine as default one. Moodle 1.9 or earlier versions are using MYISAM storage engine.raju (123050091) Under the guidance of Prof. DeepakLMS B. Phatak Optimization (IIT Bombay) 24 June 2014 17 / 55
Moodle database Moodle DB Moodle Database support MySQL, PostgreSQL, SQLite, and Oracle. In our case, we are using MySQL. Moodle database schema contains 314 tables. These tables is contain core database tables, and plugin tables. The Moodle database structure is defined in install.xml files inside the db folder in each plugin. Uses XML for updating Moodle database Moodle uses InnoDB storage engine as default one. Moodle 1.9 or earlier versions are using MYISAM storage engine.raju (123050091) Under the guidance of Prof. DeepakLMS B. Phatak Optimization (IIT Bombay) 24 June 2014 17 / 55
Moodle database Moodle DB Moodle Database support MySQL, PostgreSQL, SQLite, and Oracle. In our case, we are using MySQL. Moodle database schema contains 314 tables. These tables is contain core database tables, and plugin tables. The Moodle database structure is defined in install.xml files inside the db folder in each plugin. Uses XML for updating Moodle database Moodle uses InnoDB storage engine as default one. Moodle 1.9 or earlier versions are using MYISAM storage engine.raju (123050091) Under the guidance of Prof. DeepakLMS B. Phatak Optimization (IIT Bombay) 24 June 2014 17 / 55
Moodle database Moodle DB Moodle Database support MySQL, PostgreSQL, SQLite, and Oracle. In our case, we are using MySQL. Moodle database schema contains 314 tables. These tables is contain core database tables, and plugin tables. The Moodle database structure is defined in install.xml files inside the db folder in each plugin. Uses XML for updating Moodle database Moodle uses InnoDB storage engine as default one. Moodle 1.9 or earlier versions are using MYISAM storage engine.raju (123050091) Under the guidance of Prof. DeepakLMS B. Phatak Optimization (IIT Bombay) 24 June 2014 17 / 55
Moodle database Moodle DB Moodle Database support MySQL, PostgreSQL, SQLite, and Oracle. In our case, we are using MySQL. Moodle database schema contains 314 tables. These tables is contain core database tables, and plugin tables. The Moodle database structure is defined in install.xml files inside the db folder in each plugin. Uses XML for updating Moodle database Moodle uses InnoDB storage engine as default one. Moodle 1.9 or earlier versions are using MYISAM storage engine.raju (123050091) Under the guidance of Prof. DeepakLMS B. Phatak Optimization (IIT Bombay) 24 June 2014 17 / 55
Moodle database Moodle DB Moodle Database support MySQL, PostgreSQL, SQLite, and Oracle. In our case, we are using MySQL. Moodle database schema contains 314 tables. These tables is contain core database tables, and plugin tables. The Moodle database structure is defined in install.xml files inside the db folder in each plugin. Uses XML for updating Moodle database Moodle uses InnoDB storage engine as default one. Moodle 1.9 or earlier versions are using MYISAM storage engine.raju (123050091) Under the guidance of Prof. DeepakLMS B. Phatak Optimization (IIT Bombay) 24 June 2014 17 / 55
Moodle DB Database server architecture Moodle database server architecture 24 June 2014 18 / 55
Database log Moodle DB Database logs There are two kinds of profiling 1 Application Profiling 2 Server Profiling We can find out where database server spends most of the time by using server profiling. MySQL server has two kinds of query logs. General query log Slow query log 24 June 2014 19 / 55
Part IV Performance Testing Tools
Tools Performance Testing Tools In this project, the following performance testing tools are used[jme01]. 1 Jmeter 2 mk-query-digest 3 workbench 4 phpmyadmin 24 June 2014 21 / 55
Tools Performance Testing Tools In this project, the following performance testing tools are used[jme01]. 1 Jmeter 2 mk-query-digest 3 workbench 4 phpmyadmin 24 June 2014 21 / 55
Tools Performance Testing Tools In this project, the following performance testing tools are used[jme01]. 1 Jmeter 2 mk-query-digest 3 workbench 4 phpmyadmin 24 June 2014 21 / 55
Tools Performance Testing Tools In this project, the following performance testing tools are used[jme01]. 1 Jmeter 2 mk-query-digest 3 workbench 4 phpmyadmin 24 June 2014 21 / 55
Tools Performance Testing Tools In this project, the following performance testing tools are used[jme01]. 1 Jmeter 2 mk-query-digest 3 workbench 4 phpmyadmin.raju (123050091) Under the guidance of Prof. DeepakLMS B. Phatak Optimization (IIT Bombay) 24 June 2014 21 / 55
Part V JMeter
User Credentials Jmeter Figure: username and password 24 June 2014 23 / 55
Attempt variable Jmeter 24 June 2014 24 / 55
Attempt variable usage Jmeter 24 June 2014 25 / 55
Sesskey Jmeter 24 June 2014 26 / 55
Jmeter Sample Summary Report 24 June 2014 27 / 55
mk-query-digest mk-query-digest tool 24 June 2014 28 / 55
Part VI Design and Implementation
Functions 1 Moodle session manager 2 Moodle session database 3 create temp table 4 Cron table 24 June 2014 30 / 55
Moodle session temp table Creation of temp table 1 USE moodle; 2 CREATE TABLE mdl_sessions_temp AS SELECT * FROM mdl_sessions WHERE 1=2; 3 ALTER TABLE mdl_sessions_temp ADD primary key(id); 4 ALTER TABLE mdl_sessions_temp MODIFY id bigint(10) AUTO_INCREMENT; 24 June 2014 31 / 55
Moodle session table Moodle session table 24 June 2014 32 / 55
Creation of temp table Moodle session temp table 24 June 2014 33 / 55
Existing Functions Moodle session manager 1 init-empty-session() 2 initialise-user-session($newsid) 3 login user($user) 4 garbage collection() 5 add-session-record($userid) 24 June 2014 34 / 55
Existing Functions Moodle session database 1 read(sid) 2 write($sid, $sessdata) 3 garbage collection() 4 add-session-record($userid) 24 June 2014 35 / 55
Part VII Test cases
Test Case Details Test cases Table: Different Test cases Function Test case1 Test case2 Name of quiz SQL Quiz1 SQL Quiz2 Time(min) 10 10 Number of attempts allowed unlimited unlimited Question order shuffled Not shuffled Number of questions per page 1 all shuffle within question yes yes Grades uniform uniform 24 June 2014 37 / 55
Test cases Moodle session database 1 Numer of questions : 6 2 participants: changed dynamically 3 Type of questions: Muliple choice questions 4 Gaussian random timer used 24 June 2014 38 / 55
Part VIII System setup
System Setup Moodle session database 1 Created users using script according to required format 2 upload users required following format username,password,firstname,lastname,emailid,course number 3 Upload bulk users into moodle 4 MySQL Configuration file(my.cnf) 24 June 2014 40 / 55
Part IX Results
Results No. of Users average Error rate start attempt processing 50 8.1 0 11 8.5 75 8 0 15 7.5 100 9.97 0 14.2 9.94 125 8.5 0.25 20 16 Table: 2GB RAM Results without optimization for test case1 24 June 2014 42 / 55
Results No. of Users average Error rate start attempt processing 50 6.7 0 9.2 6.9 75 5.9 0 6.1 5.9 100 10.8 0 18 11 125 16.8 0 26 17 150 22.4 6.7 44 23 Table: 2GB RAM Results with optimization for test case1 24 June 2014 43 / 55
Results No. of Users Average Error rate Start attempt processing 50 0.4 0 1.2 0.5 100 0.57 0 2.2 1.6 150 1.6 0 7.5 5.5 200 3.6 0 11 3.9 250 10.3 13.77 7 14 Table: 4GB RAM Results without optimization for test case1 24 June 2014 44 / 55
Results No. of Users Avg Error rate Start attempt processing 50 2.7 0 0.9 0.5 100 0.7 0 0.8 0.77 150 1.6 0 1.1 1.8 200 4 0 4.4 4.2 250 6.3 0 3.2 2.4 300 7.65 8.9 7.63 7.8 Table: 4GB RAM Results with optimization for test case1 24 June 2014 45 / 55
Results No. of Users average Error rate start attempt processing 50 8.1 0 12 9.7 75 3 0 14 11 100 4.6 0 21 18 125 6.3 0 30 24 150 10.04 8.5 46 35 Table: 2GB RAM Results without optimization for test case2 24 June 2014 46 / 55
Results No. of Users average Error rate start attempt processing 50 10.7 0 32 28 75 16 0 47 42 100 21.8 0 66 55 125 27.5 0 77 69 150 28.8 0 96 28 175 31 0 82 60 200 29 0.17 77 36 Table: 2GB RAM Results with optimization for test case2 24 June 2014 47 / 55
Synch session table 1 Read last run table 2 Select records from moodle sessions temp table where timemodified>= last_run_rec 3 update sessdata,sid,userid in sessions table 4 update last_run table with system time 24 June 2014 48 / 55
Part X Conclusion and Future work
Conclusion and Feature Work Conclusion and Future work Conclusion 1 Successfully removed the database explicit locks. 2 Synch of moodle sessions and sessions_temp is done. 3 Successfully used tools like JMeter,workbench,etc. Future work 1 By adding range queries on report generation then it will gives good performance..raju (123050091) Under the guidance of Prof. DeepakLMS B. Phatak Optimization (IIT Bombay) 24 June 2014 50 / 55
Conclusion and Feature Work Conclusion and Future work Conclusion 1 Successfully removed the database explicit locks. 2 Synch of moodle sessions and sessions_temp is done. 3 Successfully used tools like JMeter,workbench,etc. Future work 1 By adding range queries on report generation then it will gives good performance..raju (123050091) Under the guidance of Prof. DeepakLMS B. Phatak Optimization (IIT Bombay) 24 June 2014 50 / 55
Conclusion and Feature Work Conclusion and Future work Conclusion 1 Successfully removed the database explicit locks. 2 Synch of moodle sessions and sessions_temp is done. 3 Successfully used tools like JMeter,workbench,etc. Future work 1 By adding range queries on report generation then it will gives good performance..raju (123050091) Under the guidance of Prof. DeepakLMS B. Phatak Optimization (IIT Bombay) 24 June 2014 50 / 55
Conclusion and Feature Work Conclusion and Future work Conclusion 1 Successfully removed the database explicit locks. 2 Synch of moodle sessions and sessions_temp is done. 3 Successfully used tools like JMeter,workbench,etc. Future work 1 By adding range queries on report generation then it will gives good performance..raju (123050091) Under the guidance of Prof. DeepakLMS B. Phatak Optimization (IIT Bombay) 24 June 2014 50 / 55
Conclusion and Feature Work Conclusion and Future work Conclusion 1 Successfully removed the database explicit locks. 2 Synch of moodle sessions and sessions_temp is done. 3 Successfully used tools like JMeter,workbench,etc. Future work 1 By adding range queries on report generation then it will gives good performance. 24 June 2014 50 / 55
Conclusion and Feature Work Conclusion and Future work Conclusion 1 Successfully removed the database explicit locks. 2 Synch of moodle sessions and sessions_temp is done. 3 Successfully used tools like JMeter,workbench,etc. Future work 1 By adding range queries on report generation then it will gives good performance. 24 June 2014 50 / 55
Conclusion and Feature Work Conclusion and Future work Conclusion 1 Successfully removed the database explicit locks. 2 Synch of moodle sessions and sessions_temp is done. 3 Successfully used tools like JMeter,workbench,etc. Future work 1 By adding range queries on report generation then it will gives good performance. 24 June 2014 50 / 55
Conclusion and Feature Work Conclusion and Future work Conclusion 1 Successfully removed the database explicit locks. 2 Synch of moodle sessions and sessions_temp is done. 3 Successfully used tools like JMeter,workbench,etc. Future work 1 By adding range queries on report generation then it will gives good performance..raju (123050091) Under the guidance of Prof. DeepakLMS B. Phatak Optimization (IIT Bombay) 24 June 2014 50 / 55
Thank You
Memcached Memcached 24 June 2014 52 / 55
Slow Queries Slow Queries 24 June 2014 53 / 55
References I Slow Queries [AT10] [BK12] Cansu Cigdem Aydin and G Tirkes, Open source learning management systems in e-learning and moodle, Education Engineering (EDUCON), 2010 IEEE, IEEE, 2010, pp. 593 600. Sadanand Y Bansode and Rajendra Kumbhar, E-learning experience using open source software: Moodle, DESIDOC Journal of Library & Information Technology 32 (2012), no. 5, http://ieeexplore.ieee.org/xplore/home.jsp, Downloaded on 20th June 2013. [jme01] Jmeter tool, http://jmeter.apache.org/, 2001, [Online; accessed 15-July-2013]. [moo] http://en.wikipedia.org/wiki/moodle, [Online; accessed 2-July-2013]. 24 June 2014 54 / 55
References II Slow Queries [PW09] M. Phankokkruad and K. Woraratpanya, Web services for learning management systems: Communication architecture, Communications (MICC), 2009 IEEE 9th Malaysia International Conference on, 2009, http://ieeexplore.ieee.org/xpls/abs_all.jsp? arnumber=5431540&tag=1, Accessed on 6th September 2013, pp. 403 408. 24 June 2014 55 / 55