Does Moodle 2.0 P4 seem slow?

Does Moodle 2.0 P4 seem slow?

by K P -
Number of replies: 20

I noticed last night as I was testing the questions feature that it just seemed very slow to respond.  Sometimes the HTML editor would take 10-15 sec to appear.  The same for pop up boxes, etc.  I assumed it was my server, but when I switched back to 1.9+ everything speed up and loaded upon clicking.  The qa.moodle.org site is the same way for me on IE7 (on two different networks: home and school).

I am hoping it is because it just hasn't been optimized yet because of current development.  Or is this an unfortunate result of ajax, java, and web 2.0 stuff?

Average of ratings: -
In reply to K P

Re: Does Moodle 2.0 P4 seem slow?

by sam marshall -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
A few parts (if correctly configured, i.e. not on debug/developer options) should be significantly faster - I'm thinking specifically of caching for the CSS and JavaScript files. However, in general, the rest of it is probably a bit slower - partly because it does more stuff, partly because there's not yet a release version and there is probably more optimisation still left to do.

When using it in general - and this is with developer options - I get the impression it's a bit slower than 1.9 but not too bad.

We are apparently going to run some load tests against current 2.0 (presumably with the idea of reproducing them against final version, if there are improvements), hopefully we will be able to post the results of those publicly.


Also - 2.0 does use significantly more advanced HTML which means using Internet Explorer, let alone old versions, probably won't result in great performance. Take a look at this graph of Javascript performance from a Microsoft blog. Notice that IE8 is about eight times slower than any other current browser. Now consider that IE7 was about twice as slow again. (And to be honest, the HTML editor has always been horrible in IE...)

So in other words, try using an alternative browser such as Firefox, Chrome, or Safari and see if you get a better experience. If so, and if for some reason you are forced to use Internet Explorer, then it might be possible to reduce the problems by choosing a simpler theme that does less fancy stuff (this won't help the html editor though).

--sam
Average of ratings: Useful (1)
In reply to sam marshall

Re: Does Moodle 2.0 P4 seem slow?

by Mauno Korpelainen -

One single note about current editor init code in lib/editor/tinymce/lib.php:

'plugins' => "{$xmedia}advimage,safari,table,style,layer,advhr,advlink,emotions,inlinepopups,searchreplace,paste,directionality,fullscreen,moodlenolink,{$xdragmath}nonbreaking,contextmenu,insertdatetime,save,iespell,preview,print,noneditable,visualchars,xhtmlxtras,template,pagebreak,spellchecker",
            
These red plugins are useless - safari plugin has been needless since tinymce Version 3.3b1 (2010-01-25) when safari code was moved to core code of tinymce and loading these other plugins is waste of time because these plugins are otherwise useless and could be removed from default init code smile

Theme designer mode (enabled) makes loading separate css files and javascripts a little slower than the case when theme designer mode is disabled - particularly in IE - but sometimes it looks like also Apache had some problems with loading various files (Apache stops responding occasionally when there are lots of files to be loaded?)

Regarding the usability of editor we discussed about number of buttons and plugins in http://moodle.org/mod/forum/discuss.php?d=130470 and I tested yesterday using userpreferences with editorswitcher the same way as Sam added style body class changes to Splash theme and I tested also a jQuery plugin for changing visible rows of toolbar (the famous WP 'kitchen sink button'). I know what people say about jQuery but... the growth of rows of yui code is remarkable...

Attachment toolbars.gif
In reply to Mauno Korpelainen

Re: Does Moodle 2.0 P4 seem slow?

by sam marshall -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Did you file a bug about the extra plugins?

--sam
In reply to sam marshall

Re: Does Moodle 2.0 P4 seem slow?

by Mauno Korpelainen -

Olli filed http://tracker.moodle.org/browse/MDL-20139 last year - but this editor configuration issue (which buttons and plugins should be loaded by default) plays only a very small part in performance problems. And editor user preferences and administration of buttons and plugins is obviously one of those things that are moved to coming versions. Petr has written nice code for using parallel editors and it is possible to change whole editors with $CFG->texteditors or even user based settings with these new yui things M.util.set_user_preference... so there is only a small step missing from fully functional administration of buttons and plugins of editors...

After my last post I actually tested how changing the init code affects loading times both theme designer mode enabled and disabled and the effect of taking away half of those plugins can't be seconds - not even in IE7. On slow connections it still causes more http requests if each plugin is loaded separately. Designer mode disabled & cache made loading editor page a couple seconds faster even in Chrome and like you said before IE9 all versions of IE have been slower than other browsers.

http://qa.moodle.net/ had some strange yui and css errors/notes in IE8 developer tools console - particularly when blocks were moved to dock and back - maybe that test site has some non core code settings or non upgraded code that slow down IE even more. But I did not get even close to 15 seconds loading times - it took maybe 2-3 seconds to load single editing page...

In reply to Mauno Korpelainen

Re: Does Moodle 2.0 P4 seem slow?

by Mauno Korpelainen -
( Off the original topic - but in fact this toolbar switcher plugin does not require jQuery at all - it's a tiny plugin that simply toggles visible toolbars in advanced theme. So if default value is set to show only first row of toolbar only the first row of buttons is loaded and you can toggle button to see the other rows of toolbar. In WordPress switching is done with jQuery but the version with "normal javascript" works as well... )
In reply to sam marshall

Re: Does Moodle 2.0 P4 seem slow?

by Jonathan Fine -
From what Kameron has said, I don't know if the problem is the server being slow or JavaScript (and the page rendering) being slow.

Sam may be right, that IE 7 is slow. If you install and use Fiddler (I've not used it myself) you'll get a log of the HTTP traffic (which will tell you if the server is slow).

http://www.fiddler2.com/fiddler2/

In reply to Jonathan Fine

Re: Does Moodle 2.0 P4 seem slow?

by sam marshall -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Yep; alternatively, specific to Moodle, if using a test server you can turn on performance information (which appears at the bottom of the page and tells you how long the server thinks it took to render the page). Sometimes this is less accurate but if the performance problems are caused by the server/database, and if it's not because the server is completely swamped with users, it's usually not bad. It also includes diagnostic information so you can guess that if it made 100,000 database queries this is probably why the page is slow.

(I think somewhere around 100,000 queries for a normal page was our record with moodle 1.something... a calendar problem, since fixed, thankfully...)

--sam
In reply to sam marshall

Re: Does Moodle 2.0 P4 seem slow?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Sam "When using it in general - and this is with developer options - I get the impression it's a bit slower than 1.9 but not too bad."

I am testing 2.0 on my local computer with a WAMP installation, standard theme, Firefox 3.6.8. I have a pretty fast machine with lots of memory and I have enabled all the settings that you mention (cache, etc.) in order to make my moodle run as fast as possible. Using Moodle 2.0 Preview 4+ (Build: 20100810).

I also have a moodle 1.9.9 on the same local machine, (also with standard theme) for comparison.

When you write that moodle 2.0 "is a bit slower than 1.9", I call that "understatement'.

I've turned on the performance indicator for both versions and here are my findings.

Where 2 times are shown (for 2.0), the second one indicates timings using the binarius theme.

  • Viewing a simple HTML page (Lorem ipsum short text):
    • 1.9: 0.475004 secs
    • 2.0: 2.854761 secs / 2.078741 secs
  • Adding an HTML page (Add resource: Add page) including display of HTM editor:
    • 1.9: 0.684996 secs
    • 2.0: 5.283031 secs / 5.842613 secs
  • Creating a multiple choice question (entering the editing page)
    • 1.9: 1.157863 secs
    • 2.0: 15.115129 secs / 14.130319 secs
  • Add a Glossary
    • 1.9: 1.154204 secs
    • 2.0: 4.432862 secs
  • Add a Quiz
    • 1.9: 1.560996 secs
    • 2.0: 10.738646 secs

etc.

For the same type of feature, moodle 2.0 is 4 to 13 times slower than 1.9. Of course the main throttle is the new TinyMCE editor, which takes ages to display on the pages. The use of the binarius theme has almost no effect compared to standard theme.

I'd be interested to hear of similar reports (based on actual figures, not just impressions) and, of course, on advice on how to make moodle 2.0 "a bit" faster. wink

Joseph

Average of ratings: Useful (2)
In reply to Joseph Rézeau

Re: Does Moodle 2.0 P4 seem slow?

by Mauno Korpelainen -
This multiple choice question editing screen is particularly slow because there can be 20 or 100 editors on the same page depending on the number of choises. And if content_css is not false in editor init code it means that each of those multiple editors loads separately custom css for pagebreak and spellchecker plugins, for skin of advanced theme and for each editor itself - if you have 100 editors on the same page it means 400 unnecessary http requests. Other css files and js files of tinymce are loaded only once or twice.

If we had a simple solution like one button near each field that would render editor div only when needed for each textarea separately rendering all those editors on the same page would be as well unnecessary - we just don't have such magic buttons yet...

Overal growth of amount of css, javascript (yui and ajax) and different new functions and new features seems to explain part of difference in performance between moodle 1.9.9 and moodle 2.0 - new editor (tinymce) seems to be playing a remarkable role only in these multiple choice questions.
In reply to sam marshall

Re: Does Moodle 2.0 P4 seem slow?

by K P -
Firefox on Mac is just as slow as on IE7. I haven't tried Safari yet. I have been consumed by another issue of my hosting company limiting database connections to 15. Had to move the whole site to a new host (1.9+ that is)
In reply to K P

Re: Does Moodle 2.0 P4 seem slow?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Kameron,

The problem is not comparing the speed of Moodle 2.0 on different browsers or platforms but comparing the speed of Moodle 2.0 and Moodle 1.9 in the same environement. My little comparative study clearly shows that Moodle 2.0 is much slower than 1.9.

I've just done the same tests to compare Moodle 2.0 on Firefox 3.6.8 and MSIE 8.0 and found that Moodle 2.0 is consistently slower on FF than on MSIE by 1 second.

Joseph

In reply to Joseph Rézeau

Re: Does Moodle 2.0 P4 seem slow?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
There must be something wrong with your set-up if you are getting 15 second page-load time. Our development server is not terribly fast, and I see much faster load times than that, even with all the developer options turned on.

I am not saying we should just ignore your findings, I just think some more measurement is required before we panic.
In reply to Tim Hunt

Re: Does Moodle 2.0 P4 seem slow?

by Mauno Korpelainen -

Tim,

I agree with you - some part of Joseph's test loading times must come from slow connection, some settings of browser (plugins of browser?) etc. - Edit: but it's a local computer ... RAM???

I tested a multiple choice question page with 19 editors on screen and the loading times varied between 3 and 6 seconds no matter if theme designer mode was enabled or disabled - cache made loading about 1 second faster on an average.

I even tested if it changes the situation if I disable javascript (in FF) and disabled editor from my profile - no big difference, 3-5 seconds - and sometimes it took even longer to load page when javascript was disabled...

But if we compare moodle 1.9 and moodle 2.0 - moodle 1.9.9 is clearly faster than moodle 2.0 on the same environment smile

In reply to Mauno Korpelainen

Re: Does Moodle 2.0 P4 seem slow?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Tim and Mauno,

OK, I'll see if there is something wrong with either my browsers, my moodle local installation or my computer RAM etc.

Do you have any ideas what I could test?

Maybe I should do a complete fresh install of moodle 2.0 to start with.

I'll keep you posted.

Joseph

PS Here is the complete performance display for displaying the page of a MCQ question in 2.0. Is there anything suspiciously slow in there?

14.671966 secs RAM: 38.2MB RAM peak: 38.3MB Included 631 files Contexts for which filters were loaded: 0 Filters created: 0 Pieces of content filtered: 0 Strings filtered: 0 get_string calls: 2053 strings mem cache hits: 1895 strings disk cache hits: 175 DB reads/writes: 1091/1


In reply to Joseph Rézeau

Re: Does Moodle 2.0 P4 seem slow?

by Mauno Korpelainen -

One possible reason might be that your PC - or what ever computer it is - does not have enough RAM and it needs to use hard disk as virtual memory which is much slower than using RAM... If you have a local WAMP or XAMPP running and some other programs running at the same time as you are browsing moodle 2 your PC might be running in the lack of RAM or processor might be running near 100%...

http://docs.moodle.org/en/Performance is talking only about server performance and requirements but there is no word about possible problems on user side - when I tested 3 different PC:s it at least looked like our oldest Windows 2000 with 500 MB RAM (+ old processor) and IE6 was totally frozen with moodle 2 and not much faster with FF 3.6 in browsing moodle 2 - it was "loading" all the time - my current test PC has 2 GB RAM and XAMPP takes right away about half of it...but it is still relatively fast with local moodle.

I really don't know the exact reason why moodle 2 seems to be slower than moodle 1.9 - timeouts here and there or doublework somewhere - but most likely there are a lot of these "tiny things" in the new code where performance experts could take some milliseconds away but I am not any kind of performance expert - just guessing as much as I can... smile

In reply to Joseph Rézeau

Re: Does Moodle 2.0 P4 seem slow?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Well I finally installed a fresh Moodle 2.0 Preview 4+ (Build: 20100811) and I am glad to report that performance is significantly better than the figures I previously reported! For example, my worst waiting time was when creating an MCQ question (14.671966 secs) now it takes

2.979554 secs on Firefox 3.6.8.

3.127821 secs on MSIE 8.

This is quite reasonable!approve

Maybe the reason is that my previous 2.0 install, which I upgraded regularly and used intensively for tests had developed some "slowing down factor" e.g. in the database?

Joseph

Average of ratings: Useful (1)
In reply to Joseph Rézeau

Re: Does Moodle 2.0 P4 seem slow?

by Alejandro Michavila Pallarés -
I experience a reasonable slowness using Moodle 2.0 Preview 4+ (Build: 20100803) on LAMP (with debug/developer options, standard theme and one user) comparing to the same Moodle 1.9.9 conditions, using Firefox 3.6.8.

PHP memory limit was increased to 128M:

memory_limit = 128M ; Maximum amount of memory a script may consume (16MB), previous value (48MB)
In reply to Joseph Rézeau

Using moodle 2.0

by Mohamed alam -

i create category. then click on question bank select multiple choice.

The choice1,choice2,choice3, choice4 options are disabled. Please help me with this.true or false is working. i see problem with multiple choice. please help me.

In reply to K P

Re: Does Moodle 2.0 P4 seem slow?

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Kameron, thanks for your help with testing Moodle 2.0. I'm just going to move this discussion thread to the testing and QA forum so others can find it easily...