+44 (0)2 0718 39207
info@enovationsolutions.co.uk
  • Client Support
  • FR
  • IE
EnovationEnovationEnovationEnovation
+44 (0)2 0718 39207
  • WHAT WE DO
    • OUR SERVICES
      • Consultancy
      • Content Creation
      • Build & Design
      • Training
      • Hosting
      • Support & Maintenance
    • OUR SOLUTIONS
      • Moodle
      • Moodle Workplace
      • The LMS Totara Learn
      • Aura Talent
  • WHO WE ARE
    • About Enovation
    • Careers
  • CASE STUDIES
    • Smyths Toys
    • Tata Chemicals Europe
    • Courts Service of Ireland
    • OpenJaw
    • New College Lanarkshire
  • OUR PARTNERS
    • IntelliBoard
    • BigBlueButton
  • INSIGHTS
  • CONTACT US

PHP 5.5 vs PHP 7 performance comparison for Moodle 3.0

    Home Blog PHP 5.5 vs PHP 7 performance comparison for Moodle 3.0

    PHP 5.5 vs PHP 7 performance comparison for Moodle 3.0

    Enovation Admin | Blog, News | 15 November, 2015

    There is a lot of interesting things going on in the Moodle & PHP worlds recently – Moodle 3.0 has just been released and PHP 7 release is coming soon. Among other things, PHP 7 promises a great performance improvement over PHP 5.6 – PHP 7 is supposedly up to 2 x faster.

    We have decided to put that into the test by simulating real-world Moodle 3.0 usage scenario. After a quick Moodle PHP 7 bug fix  and hack to ignore Moodle version check, we were able to install Moodle using PHP 7.

    The environment used for testing:

    • Moodle: 3.0rc4 (Build: 20151113)
    • PHP: Version 7.0.1-dev with Zend OPcache v7.0.6-dev vs PHP Version 5.5.9 with Zend OPcache v7.0.3 (Ubuntu 14.04 packaged version)
    • OS: 64 bit Ubuntu 14.04
    • Mysql server 5.5
    • Physical machine with:
      • 16GB RAM
      • one 2GHz i7-2630QM CPU (4 cores, 8 threads)
      • SSD hard drive

    The test was performed with jmeter running on the same machine.  This has affected the performance of the system but it should be the same overhead for running both PHP versions, so it should not matter for the comparison. We have tested 200 users answering 100 quiz questions each. Each user had a separate account and started his run by login, followed by answering 100 questions and submitting the quiz. Every question was on a separate page, so each user generated over 200 page hits. The test was set up to run 20 threads in parallel. The timings are taken from jmeter statistics and from Moodle performance reporting (MDL_PERF). After switching PHP version we have run & discarded dozens of jmeter tests to warm up all caches. All tests were executed with opcache enabled.

    The results are grouped by PHP script that was run and show:

    • the times it took to execute each PHP script (with minimum time, maximum, average and standard deviation) measured in seconds
    • values like above for CPU time (the time that CPU has spent working on each request) in seconds
    • memory used shown in MB

    The most relevant values for a comparison like this are CPU time and memory used, so let’s see how well did PHP 7 do compared to PHP 5.

    PHP 5.5 results

    script count min_time max_time avg_time std_time min_cpu max_cpu avg_cpu std_cpu mem_min mem_max mem_avg mem_std
    /login/index.php 200 1.09 3.21 2.01 0.40 0.94 1.05 0.98 0.02 4.71 4.71 4.71 0.00
    /mod/quiz/attempt.php 20200 0.20 1.68 0.80 0.18 0.19 0.49 0.43 0.01 10.84 11.01 10.94 0.03
    /mod/quiz/processattempt.php 20199 0.06 2.23 0.45 0.16 0.06 0.73 0.23 0.05 10.10 11.71 10.16 0.15
    /mod/quiz/review.php 200 0.28 1.57 0.96 0.27 0.26 0.49 0.45 0.04 11.52 11.56 11.54 0.01
    /mod/quiz/startattempt.php 200 1.80 4.42 2.80 0.55 1.18 1.30 1.24 0.02 12.04 12.07 12.06 0.01
    /mod/quiz/view.php 200 0.22 1.19 0.71 0.17 0.21 0.36 0.32 0.01 12.16 12.16 12.16 0.00

    PHP 7 results

    script count min_time max_time avg_time std_time min_cpu max_cpu avg_cpu std_cpu mem_min mem_max mem_avg mem_std
    /login/index.php 200 0.96 2.33 1.29 0.23 0.87 1.01 0.94 0.02 3.23 3.23 3.23 0.00
    /mod/quiz/attempt.php 20200 0.04 0.72 0.24 0.07 0.04 0.31 0.18 0.02 7.31 7.43 7.38 0.02
    /mod/quiz/processattempt.php 20198 0.03 1.27 0.15 0.06 0.02 0.32 0.09 0.02 6.04 7.50 6.09 0.14
    /mod/quiz/review.php 200 0.08 0.57 0.30 0.08 0.05 0.22 0.20 0.02 7.74 7.76 7.74 0.00
    /mod/quiz/startattempt.php 200 0.18 2.71 0.94 0.42 0.13 0.56 0.50 0.04 7.44 7.50 7.45 0.01
    /mod/quiz/view.php 200 0.06 1.26 0.25 0.11 0.05 0.20 0.15 0.01 7.67 7.67 7.67 0.00

    PHP 5.5 vs 7

    The table below show how much % of time / memory was consumed by PHP 7 compared to PHP 5.5.

    script avg_cpu_time avg_time memory_avg
    /login/index.php 96.03 64.22 68.55
    /mod/quiz/attempt.php 41.96 30.57 67.45
    /mod/quiz/processattempt.php 41.85 33.25 59.95
    /mod/quiz/review.php 43.88 31.65 67.13
    /mod/quiz/startattempt.php 39.92 33.57 61.75
    /mod/quiz/view.php 45.69 35.14 63.06

    In summary, PHP 7 performed more than 2 time faster compared to PHP 5.5 while consuming only 60% of the memory that PHP 5.5 did. Statistics from jMeter confirm that – PHP 5.5 was able to process on average 10 requests per second, while PHP 7 20 requests/second.

    Keep in mind that the above does not mean that your users will get this kind of performance improvement as soon as you switch to new PHP version. The time measured here is a CPU time on the server side, which is just a fraction of the whole time needed to render the page for end user. Once you add network latency, loading media and rendering the page by the browser – the end result will be much less spectacular. Having said that the results are quite impressive – go PHP 7!

    Next Previous
    Moodle 3.0, PHP 7

    Related Post

    • alt=LMS info graphic outlining the aspects of a learning management system

      LMS for Retail Success

      Emma Cronin | Blog, News | 7 August, 2019

      Retail is a notoriously unpredictable industry that is dictated by its seasonal changes, trends and high staff turnover. When retailers equip their staff members with the necessary training and knowledge and skills cost-effectively, without interrupting their busy schedules, a culture of empowerment and encouragement is created. By introducing a cost-effective and customisable LMS, retail businesses are given the power to stay ahead of the curve.

    • Moodle 2.9 Now Available

      Enovation Admin | Blog, Moodle, News | 11 May, 2015

      It gives us great pleasure to officially announce the release of Moodle 2.9. A simple & friendlier version of Moodle. Moodle 2.9 features a user-friendly redesign of the user-interface for the benefit of teachers, students andRead more

    • Welcome to the new Enovation blog

      Mark Melia | Blog, News | 17 December, 2010

      Hello and welcome to the new Enovation Solutions Technical blog. This is the place to go to find all the latest and greatest developments, news and musings from the technical team at Enovation Solutions. Enovation’sRead more

    NextPrevious

    Latest Insights

    • 25 August, 2019
      Comments Off on 5 Signs Your LMS Isn’t Working

      5 Signs Your LMS Isn’t Working

    • 14 August, 2019
      Comments Off on Digital Content for Learner Engagement

      Digital Content for Learner Engagement

    • alt=LMS info graphic outlining the aspects of a learning management system
      7 August, 2019
      Comments Off on LMS for Retail Success

      LMS for Retail Success

    • alt=Concentrated female working on an eLearning course
      23 July, 2019
      Comments Off on Collaborative e-Learning

      Collaborative e-Learning

    Archives

    • August 2019
    • July 2019
    • June 2019
    • May 2019
    • March 2019
    • January 2019
    • December 2018
    • October 2018
    • September 2018
    • July 2018
    • June 2018
    • May 2018
    • April 2018
    • March 2018
    • February 2018
    • January 2018
    • November 2017
    • October 2017
    • September 2017
    • August 2017
    • July 2017
    • June 2017
    • May 2017
    • April 2017
    • March 2017
    • January 2017
    • November 2016
    • October 2016
    • June 2016
    • March 2016
    • February 2016
    • January 2016
    • December 2015
    • November 2015
    • October 2015
    • September 2015
    • July 2015
    • June 2015
    • May 2015
    • March 2015
    • February 2015
    • January 2015
    • December 2014
    • November 2014
    • September 2014
    • June 2014
    • May 2014
    • January 2014
    • August 2013
    • April 2013
    • March 2013
    • February 2013
    • September 2012
    • July 2012
    • May 2012
    • April 2012
    • February 2012
    • December 2011
    • November 2011
    • June 2011
    • May 2011
    • April 2011
    • March 2011
    • February 2011
    • January 2011
    • December 2010

    Sign-up to get our insights direct to your inbox

      Enovation Square

      Enovation Solutions Ltd.,
      T: +44 (0) 2071839207

      Partners & Certifications

      Totara Partner Logo

      Latest Insights

      • 5 Signs Your LMS Isn’t Working

        At Enovation, we want to add value to your company with an effective learning management solution. This article will outline some telltale signs your current software isn’t working for you and what you should be looking for from your future LMS to ensure success.

        25 August, 2019
      • Digital Content for Learner Engagement

        Whatever stage of the eLearning journey you and your business are on, we can help you to bring your project to a successful conclusion. Few companies can offer the breadth of expertise across project management, technology, instructional design, content authoring and learning and development that our team can. Choosing us as your partner will ensure that your eLearning project is a success.

        14 August, 2019
      • alt=LMS info graphic outlining the aspects of a learning management system

        LMS for Retail Success

        Retail is a notoriously unpredictable industry that is dictated by its seasonal changes, trends and high staff turnover. When retailers equip their staff members with the necessary training and knowledge and skills cost-effectively, without interrupting their busy schedules, a culture of empowerment and encouragement is created. By introducing a cost-effective and customisable LMS, retail businesses are given the power to stay ahead of the curve.

        7 August, 2019

      Latest Tweets

      Tweets by @EnovationIRE
      • Legal Information
      © 2021 Enovation Your eLearning Partner
      • WHAT WE DO
        • OUR SERVICES
          • Consultancy
          • Content Creation
          • Build & Design
          • Training
          • Hosting
          • Support & Maintenance
        • OUR SOLUTIONS
          • Moodle
          • Moodle Workplace
          • The LMS Totara Learn
          • Aura Talent
      • WHO WE ARE
        • About Enovation
        • Careers
      • CASE STUDIES
        • Smyths Toys
        • Tata Chemicals Europe
        • Courts Service of Ireland
        • OpenJaw
        • New College Lanarkshire
      • OUR PARTNERS
        • IntelliBoard
        • BigBlueButton
      • INSIGHTS
      • CONTACT US
      Enovation
      +44 (0)2 0718 39207