+353 (0)1 602 4784
info@enovation.ie
  • Client Support
  • FR
  • UK
EnovationEnovationEnovationEnovation
+353 (0)1 602 4784
  • WHAT WE DO
    • OUR SERVICES
      • Consultancy
      • eLearning Content
      • Build & Design
      • Training
      • Moodle Educator Certification Program (MEC)
      • Hosting
      • Support & Maintenance
    • OUR SOLUTIONS
      • Aura Talent
      • Moodle
      • Moodle Workplace
      • Totara’s Talent Experience Platform
        • Totara Learn
        • Totara Engage
        • Totara Perform
      • Mahara
      • Go1 Premium Content
  • WHO WE ARE
    • About Enovation
    • Careers
  • CASE STUDIES
  • OUR PARTNERS
    • Microsoft Teams
    • 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

    • 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

    • 1 March, 2021
      Comments Off on Upcoming Webinar: Must-Have Moodle Plugins for 2021

      Upcoming Webinar: Must-Have Moodle Plugins for 2021

    • 23 February, 2021
      Comments Off on Learn2Analyze MOOC B Launches on March 1st 2021

      Learn2Analyze MOOC B Launches on March 1st 2021

    • 19 February, 2021
      Comments Off on Totara Perform: The Flexible Performance Management Platform that Works for them and for you.

      Totara Perform: The Flexible Performance Management Platform that Works for them and for you.

    • 17 February, 2021
      Comments Off on Guest Post: 3 Reasons Why Collaborative Learning is the Key to Employee Engagement

      Guest Post: 3 Reasons Why Collaborative Learning is the Key to Employee Engagement

    Archives

    • March 2021
    • February 2021
    • January 2021
    • December 2020
    • November 2020
    • October 2020
    • September 2020
    • August 2020
    • July 2020
    • June 2020
    • May 2020
    • April 2020
    • March 2020
    • February 2020
    • January 2020
    • November 2019
    • October 2019
    • September 2019
    • August 2019
    • July 2019
    • June 2019
    • May 2019
    • March 2019
    • February 2019
    • January 2019
    • December 2018
    • November 2018
    • October 2018
    • September 2018
    • August 2018
    • July 2018
    • June 2018
    • May 2018
    • April 2018
    • March 2018
    • February 2018
    • January 2018
    • December 2017
    • 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
    • January 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.,
      The Friary,
      Bow Street,
      Dublin, D07 X680,
      T: +353 (0) 1 602 4784

      Partners & Certifications

      images

      Moodle Partner Logo

      Latest Insights

      • Upcoming Webinar: Must-Have Moodle Plugins for 2021

        The Moodle plugins directory contains over 1,700 plugins, so it can be

        1 March, 2021
      • Learn2Analyze MOOC B Launches on March 1st 2021

        Date: 1 March 2021-1 May 2021 | Duration: 9 weeks| Pre-Requisites: None| Time Commitment: 100 hours in total | Certificate available: Yes| Costs: Free (course and certificate)

        23 February, 2021
      • Totara Perform: The Flexible Performance Management Platform that Works for them and for you.

        Totara Perform is the performance management software that boosts workforce productivity. You can develop your people into the very best they can be with a flexible performance management platform that works for you both.

        19 February, 2021

      Latest Tweets

      Tweets by @EnovationIRE
      • Legal Information
      © 2021 Enovation Your eLearning Partner
      • WHAT WE DO
        • OUR SERVICES
          • Consultancy
          • eLearning Content
          • Build & Design
          • Training
          • Moodle Educator Certification Program (MEC)
          • Hosting
          • Support & Maintenance
        • OUR SOLUTIONS
          • Aura Talent
          • Moodle
          • Moodle Workplace
          • Totara’s Talent Experience Platform
            • Totara Learn
            • Totara Engage
            • Totara Perform
          • Mahara
          • Go1 Premium Content
      • WHO WE ARE
        • About Enovation
        • Careers
      • CASE STUDIES
      • OUR PARTNERS
        • Microsoft Teams
        • IntelliBoard
        • BigBlueButton
      • INSIGHTS
      • CONTACT US
      Enovation
      +353 (0)1 602 4784