Moodle Performance Concern

Moodle Performance Concern

by Jody Florian -
Number of replies: 2

Hello,

I'm new to Moodle and am evaluating it for a project that I expect to have most traffic on public content pages.

Out of the box with an empty database, (Ubuntu Hardy, Apache 2, PHP 5, with xCache on a dual 3GHz CPU box with 4MB RAM), Moodle 2.0+ is loading pages no faster than 0.77 seconds for a non-registered user, and 1.77 seconds for admin. Not good! Does it sound like I am doing something wrong here? I can't imagine anyone using this software with such stats.

I would have hoped to see infrequently changing public content pages load in under 0.2 seconds. I imagine there's a caching solution (which I would like to hear about) but may or may not address performance for registered users and frequently changing pages.

(Incidentally I saw a question but no answer to this: has performance for Moodle 2.0 been given a low priority while major features/problems are being fleshed/flushed out?)

On reading around I saw comments that version 1.9 was significantly faster, so I might switch to that while 2.0 is improved.

So is Moodle 2.0+ ultra slow or is it just my set up?

Thank you

Average of ratings: -
In reply to Jody Florian

Re: Moodle Performance Concern

by Myles Carrick -
hi Jody,

Welcome to Moodle. That is indeed slow for an Ubuntu server (even an older distro like Hardy). My MacBook Pro, for instance, is faster than that in development.
There will be a huge performance advantage from using a PHP cache like APC. Google Ubuntu Hardy + PHP + APC for advice installing APC on your system. I used to install it via PHP's pecl / pear libraries back on Hardy.
In later distrubutions (like the latest LTS release of Ubuntu) it's a simple as `apt-get install php-apc`

Other than that, the list at http://docs.moodle.org/en/Performance is the best place to start for tips and tricks. Do keep in mind though too, that Moodle is not a lightweight system. Its roles and permissions hierarchy, for instance, is very finely granular and is one small element that contributes to the page load times. There is also a lot of work being done in performance tuning for 2.x - I'd definitely go with that and enjoy the improvements that will hit in upcoming months!

All the best with your Moodling - let us know if we can help further.

Myles
In reply to Jody Florian

Re: Moodle Performance Concern

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Myles has explained way in which you might be able to tune your set-up.

On the question of where Moodle 2.0 is at right now, it is feature-complete, and relatively bug-free. However, it has only just been released, and there is a lot of new code there that has not yet be been exposed to real production loads very much yet.

It can be very hard to find the performance bottlenecks during development. You really need a few brave early-adopters to find the worse problems for you wink As a fairly silly example, in some code I wrote recently for the OU, it worked fine on my development machine. When were were testing it on a copy of our live database, one particular operation was taking 20 minutes, which was crazy. I went back and looked a the code, and it was basically a sequence of five database operations. I then spent a lot of time trying to optimise one the the queries that was obviously the slow one, without luck. Then I actually measured the time the each query was taking, and it turned out that it was one of the queries that looked quite simple that was taking 20 minutes. Then I was able to tweak that query, and once I had done that it took 0.1s.

So, what I am saying is that in all the Moodle 2.0 code, despite the fact that it is designed to work with reasonable performance, there will be some strange bits that need to be tuned up, once we see how the behave at realistic loads. Mostly, when we find those places, doing the tuning up will be relatively easy. And that sort of activity is actively going on now. There is quite a good thread about profiling Moodle 2.0 elsewhere in this forum.

On the other hand, Moodle 2.0 does a lot more stuff than Moodle 1.9 did. I think it is inevitable that even after all the new code has been well tuned, it will be a little slower than 1.9 on the same hardware.