1 / 78

Optimizing Moodle LMS to Improve User Response Time

Optimizing Moodle LMS to Improve User Response Time. Summer Internship Project 2013 Under the guidance of Professor D. B. Phatak Computer Science Department Indian Institute of Technology, Bombay. Project In charge : Mr. Nagesh Karmali Team Members : Miss Priyanka Manchanda

huey
Télécharger la présentation

Optimizing Moodle LMS to Improve User Response Time

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Optimizing Moodle LMS to Improve User Response Time Summer Internship Project 2013 Under the guidance of Professor D. B. Phatak Computer Science Department Indian Institute of Technology, Bombay

  2. Project In charge : Mr. NageshKarmali Team Members : Miss Priyanka Manchanda Miss. AkshayaMuralidharan Mr. Surya Pratap Singh Mr.Mevin Dominic Mr.PawanDeshmukh Miss. SlipaReddy Miss. Shabna T. R

  3. Agenda Introduction to Moodle Front-End Optimization Techniques Study of Performance of Moodle Back-End Optimization Hardware Optimization Client-server communication mechanismFor Moodle’s Quiz Plugin Policy Enforcement Framework

  4. Scope of the Project Enhancing performance of web applications Delay of one second can reduce customer satisfaction by up to 16% Optimize Moodle ≈ Optimize Web Applications

  5. Introduction to Moodle

  6. Introduction to Moodle Modular Object Oriented Learning Environment. Open Source Course Management System (CMS) Developed by Martin Dougiamasdesigned for creating effective online learning sites. Focus on interaction and collaborative construction of content, and First Version, 20 August 2002

  7. Moodle Statistics 83059 currently active sites 236 countries 70,696,570 users 7.5+ million courses 1.2+ million teachers Source : https://moodle.org/stats

  8. Moodle Architecture Server

  9. FRONT – END OPTIMIZATION

  10. Techniques Discussed Caching by using Far Future Expires Header Reduce DNS Lookups Gzip Components Deactivating Etags Caching AJAX Components

  11. Caching By Using Far Future Expires Header Browser uses cache to Reduce the number of HTTP Requests Reduce the size of HTTP Requests Make web page load faster – reduce user response time Expires Header is used to inform client to use the current copy until the specified time. Moodle’s default Expires Header is set in past (20th Aug 1969 09:23 GMT) Experiment for Expires Header in future (changing httpd.conf) (16th April 2015 20:00 GMT)

  12. Experimental Setup 1GB RAM, 128GB SSD Intel® Core™ i5-2310 CPU @ 2.90GHz 4 Processor. Chat activity Login -> View Course -> View Chat Page -> Initialize Chat -> Initialize Initial Update Looped 5 times: Post Chat -> Initialize Chat Update 1 user and 1 iteration, 15 samples Apache Jmeter.

  13. Results Reduction of 74.14% in average user response time

  14. Reduce DNS Lookups Internet finds servers through IP addresses Domain Name Servers map hostnames to IP addresses. The browser is idle until the DNS lookup is completed. EXPERIMENT: Calculated and Observed the difference in average user response time for a client on a network with average download speed of 2.035 Mbps

  15. Results Reduction of 1.84 seconds in average user response time if the page is found in DNS Cache

  16. Reduce DNS Lookups Scenario 1: DNS Cache Entries = 20 DNS Cache Expiration Period = 60 seconds HTTP Keep Alive Timeout =115 seconds Scenario 2: DNS Cache Entries = 512 DNS Cache Expiration Period = 3600 seconds HTTP Keep Alive Timeout =115 seconds Scenario 3: DNS Cache Entries = 512 DNS Cache Expiration Period = 3600 seconds HTTP Keep Alive Timeout =0 second 100 iterations.

  17. Results • Scenario 2 provides the best results. • Increasing the number of DNS cache entries • Increasing DNS expiration period • Network supports HTTP keep-alive Average

  18. Gzip Components Accept-Encoding header in the HTTP request. Content-Encoding header in the response.

  19. Gzip Components Reduction of 617.818 KB in size of request after compression

  20. Deactivating ETags Etag – Entity Tag identifies a specific version of a component ETags are unique to a specific server hosting a site Won’t match when a browser gets the original component from more than one server and makes a conditional GET request that goes to a different server Deactivating Etags reduces the response Header size by 48 bytes.

  21. Caching AJAX Components With Ajax, Moodle can send data to, and retrieve data from, the server asynchronously (in the background) without interfering with the display and behavior of the existing page. To enable caching of AJAX Components in Moodle Open /var/www/moodle/lib/outputrendering.php Update the Expires header from past to supported far future.

  22. Caching AJAX Components For Drag & Drop component: Without Caching: 309 ms With Caching: 227 ms Performance Improvement: 26.5%

  23. Study of Moodle Performance & Bottlenecks

  24. Study of Moodle Performance & Bottlenecks • Tests were conducted using JMeter • JMeter plugin for Moodle generates scripts for different activity modules

  25. Study of Moodle Performance & Bottlenecks

  26. Study of Moodle Performance & Bottlenecks • The tests are constructed for a built-in QUIZ plug-in on Moodle with 1 question which involves • Login • View Course • View Quiz • Start Attempt • Submit Quiz • Finish Attempt • Logout.

  27. Comparing Timers • Constant Timer: Each thread pauses for the same amount of time between requests. • Gaussian Random Timer: Each thread request for a random amount of time, with most of the time intervals occurring near a particular value. • Uniform Random Timer: Each thread request for a random amount of time, with each time interval having the same probability of occurring. • Constant Throughput Timer: This timer introduces variable pauses, calculated to keep the total throughput (in terms of samples per minute) as close as possible to a give figure. • Synchronizing Timer: The purpose of the SyncTimer is to block threads until X number of threads have been blocked, and then they are all released at once.

  28. Comparing Timers Average Response Time (ms)

  29. Response Time vs Number of Users Server Details: 2 Intel Xeon 6 core processor, 96 GB RAM, 1 TB HDD Default Moodle setup with LAMP. Ramp-Up Period : 1 s (To simulate real time traffic) No. of loops : Forever We test until we obtain a java.net.connectionexception due to connection timeout. The number of threads is increased from 100 in steps of 100.

  30. Response Time vs Number of Users

  31. Back End Optimization

  32. Moodle: Apache HTTP vs. LigHTTPd

  33. Comparing Apache HTTP and Lighttpd

  34. Overcoming Table Size Limitations mdl_backup_controllerstable 22,500 entries 1.6 GB of space biggest table in the database. script to deletes all controllers over a week old. #!/bin/bash mysql-u YOURDATABASEUSERHERE -pYOURPASSWORDHEREmoodle <<EOF DELETE FROM mdl_backup_controllers WHERE timecreated< unix_timestamp(now() - interval 7 day) EOF

  35. Improvement in Grading System To create an instance of activity "modulename_grade_item_update()" "grade_update()" function. Activity always has a grade of zero, $glossary->scale==0 $quiz->grade==0 $hotpot->grade==0, Use parameter setting: $PARAMS[‘gradetype’]=‘GRADE_TYPE_NONE’ Result - no grade item created for the activity. Activity may be edited , a non-zero grade becomes possible. Use the setting $PARAMS[‘gradetype’]=‘GRADE_TYPE_VALUE’

  36. Improvement in Grading System Set Activity to zero "modulename_grade_item_update()" set "gradetype" to GRADE_TYPE_NONE call "grade_update()", grade item not deleted from gradebook Result – Grade book contains an entry for an activity that can only ever get a zero grade. Not allowed to change back to zero/none value Avoid activities with zero grade.

  37. Removing irrelevant links during quiz Communication of Moodle core and the plugin looking for particular entry points, defined in the file lib.php View.php prints a particular instance of real time quiz Changes made : Define global variable $flag in the file /mod/realtimequiz/view.php Set it's value to 1. Value reset to 0 during quiz Used to control the display of the links

  38. HARDWARE OPTIMIZATION MEVIN .M. DOMINIC & PRIYANKA MANCHANDA

  39. SSD FEATURES Durability Non Mechanical Design NAND FLASH Shock Resistant SSDs are Faster 10 – 100 times depending on the genereation Speeds vary from some MB/s to a few GB/s. SSDs Consume Less Power 2W v/s 6W even at Peak Load

  40. SSD FEATURES SSDs are Lighter Average Case – HDD at least 10 times heavier SSDs are Cost-Efficient Expensive, $1.00 per gigabyte (based on buying a 240GB drive) Only around $0.075 per gigabyte, very cheap (buying a 4TB HDD. SSDs are Cooler SSDs are Quieter

  41. An Experiment On Quiz Module Objective : Database optimization Experiment Details Fivequestions. A mix of different types. Two users Quiz - a random way. Querieslogged.

  42. Query Log Number of queries generated Flushing the query log

  43. Systems Used Test done for Fourdifferent systems Varying configurations of RAM & CPU. 554 queries logged for quiz Systems used HP laptop (HDD) -- CORE™ i3 processor (4GB RAM) DELL XPS laptop (HDD) -- CORE ™ i5 processor (8GB RAM) DELL XPS laptop (HDD) -- CORE ™ i7 processor (6GB RAM) Desktop System (HDD+SSD) -- CORE ™i5 processor (4GB RAM)

  44. Results(in s) For Single User

  45. Factor - Single User Average User Time for a single user HDD - 3.7525 sec SSD - 0.7525 sec Factor = 3.65

  46. Results(in s) – 100 users • Factor = = 3.68

  47. Conclusion • Factor of 3.5 for both single user and 100 users. • The latency at the database can be reduced loading it in an SSD. • MySQL database supports more users for higher RAM. • Hence SSD servers (e.g. Power Edge Series-DELL) can boost up the performance of Moodle.

  48. Focusing over client-server communication mechanism(Moodle Quiz).

  49. Proposed Techniques for Experimentation Implementation of Long-polling. (Applicable for real time use) 2. Random-Batch Mode Algorithm.

  50. Long Polling The Web client keeps a pending connection that’s closed only when some updated response can be returned. Benefits: A smaller number of requests to the server Repeated Request method to check the updated data takes time to established

More Related