Moodle 2.3 Slowness / freezing when editing a course

Moodle 2.3 Slowness / freezing when editing a course

mr 626發表於
Number of replies: 22

Hello all,

Long time moodle user, but first time poster here. 微笑

Just wondering if I might be able to get people's thoughts on this issue we are experiencing here and hopefully how to resolve it. First, the information about our config:

Moodle info:

moodle   version 2.2 is required and you are running 2.3 (Build: 20120625)version 2.2 is required and you are running 2.3 (Build: 20120625) OK
unicode   must be installed and enabledmust be installed and enabled OK
database mysql version 5.1.33 is required and you are running 5.5.25version 5.1.33 is required and you are running 5.5.25 OK
php   version 5.3.2 is required and you are running 5.3.8version 5.3.2 is required and you are running 5.3.8

Using php accelerator APC.

Moodle usage stats: around 500 registered users, maximum around 30 concurrent users

Server info:

Dual Quad core Xeon, 12GB ram, 7200rpm enterprise sata disks, gigabit ethernet. Running Opensuse 12.1 x64. Server is located on site, but is accessed across the internet via our 20Mbit link.

  • Everything runs great both locally and externally. With debugging on in moodle, I can see that page load times are typically around 0.5 seconds, even for courses with lots of content.
  • As a non-editing user (such as a student) everything works fine in whatever browser is used (Internet Explorer, Firefox, Chrome).
  • I've used tools such as the mysqltuner perl script to ensure the database is properly configured
  • Have checked for missing database indexes (there are none).
  • Summary- this is a brand new server especially purchased for our moodle instance, and everything runs great other than the issue I describe below.

The Problem:

  • As an editing user (such as a teacher), if you enter a course where you have editing rights and click 'turn editing on' the problem starts:
    • In Chrome or Firefox, there is a noticeable delay while the course reloads with editing on. During this time the browser appears unresponsive (and in some cases the computer will actually report the browser program as being 'non-responsive' Typically this situation lasts around 15 seconds, and then the course finishes loading successfully
    • In Internet Explorer (8 or 9) the problem is much worse. In around 90% of my testing, when I try to edit a course in Internet Explorer the browser becomes unresponsive and never recovers. Once or twice the browser reports that a 'script is taking to long to load' and gives me the option to stop the script, but this doesn't appear to do anything.
    • In summary- turning editing on inside a course causes (at best) a 15 second page load time or (at worst) a non-responsive/crashed browser, depending on what browser is being used.

What I've tried so far / observations:

  • I have the performance/debugging information being printed on the footer of each moodle page, however it doesn't seem to reflect the 'real world' page load time. For example, for a course in editing mode in will typically list a load time of around 2 seconds, when in actual fact it took around 15 seconds for the page to become responsive after turning on editing.
  • I've noticed that when editing a course it does appear to be causing higher than expected CPU usage on the client. For example, on a test machine (Pentium D 3ghz, 1gb ram, Win7, FIrefox 13) the Firefox process uses about 50% CPU during the period when the browser appears 'frozen'. Even after the browser has become responsive again, CPU usage remains at around 30-40% for the Firefox process even when I'm just sitting on the page doing nothing.
  • I've tried to use the Firebug addon for Firefox and the internal element inspecting tools of Chrome to narrow down what is causing the freezing/slowness, but I don't have much experience with this. If anyone can suggest what I should be looking for I'd greatly appreciate it.

For the moment, I'm just asking teaching staff to use Firefox if they are editing courses. The problem doesn't impact our students since they aren't editing anything.

Apologies for the long post. Just wanted to make sure I included as much information as possible. If there is additional information I can provide that would be helpful please let me know.

So, if anyone has tips or suggestions about how I can resolve this issue I would really appreciate your input. As mentioned using a browser other that IE is a workaround that will suffice for the short term, but I'd like to get to the bottom of it.

Thanks in advance for your replies.

評比平均分數:Useful (1)
In reply to mr 626

Re: Moodle 2.3 Slowness / freezing when editing a course

Dan Poltawski發表於
Hi,

This sounds like it could be a bug, a similar issue has been reported here: MDL-34328
評比平均分數:Useful (1)
In reply to Dan Poltawski

Re: Moodle 2.3 Slowness / freezing when editing a course

mr 626發表於

Dan,

Thanks- that sounds like exactly what is happening for us (I swear I searched the bug tracker before posting, but I didn't see that).

I had also considered turning off the ajax side of things to see if that helped, but it sounds like it doesn't. Not to mention all our users love those features so I'd hate to have to turn them off.

Pleased to hear I'm not alone with this issue. If I can assist in troubleshooting / tracing I'm happy to.

In reply to mr 626

Re: Moodle 2.3 Slowness / freezing when editing a course

llywelyn morgan發表於

we're experiencing the same problem

In reply to llywelyn morgan

Re: Moodle 2.3 Slowness / freezing when editing a course

llywelyn morgan發表於

doesn't seem to be such a big problem with chrome.  more so with ie and firefox.  all three are fully up to date.

In reply to llywelyn morgan

Re: Moodle 2.3 Slowness / freezing when editing a course

mr 626發表於

I would agree with this- Chrome is certainly the 'best' of the three. Chrome is more liberal with using system resources however and I expect this is why it seems better- Chrome uses more CPU cycles etc and as a result whatever user-side operation is causing this slowness when turning editing on is more quickly dealt with (IE says its a script, but I haven't been able to verify that).

The problem I faced initially (and this is my fault for not checking)- I use mainly Chrome on my Office machine whilst my users run Firefox or IE. So for a while I wasn't seeing the problem!

In reply to mr 626

Re: Moodle 2.3 Slowness / freezing when editing a course

Visvanath Ratnaweera發表於
Particularly helpful Moodlers的相片 Translators的相片
Isn't is nice of Chrome to catch a problem in Moodle?

Yes, Google is the way to go!
傷心

I don't know whether this is related. There was an injected JavaScript jamming Firefox for months http://moodle.org/mod/forum/discuss.php?d=204364. Apparantly that script has been corrected now: http://moodle.org/mod/forum/discuss.php?d=205454&parent=903927.

BTW, mr 626, nice problem description in the OP. I wish, you posted it in the "Hardware and performance" forum, http://moodle.org/mod/forum/view.php?id=596.
In reply to Visvanath Ratnaweera

Re: Moodle 2.3 Slowness / freezing when editing a course

mr 626發表於

Sorry, I didn't see that forum to post in.

In reply to mr 626

Re: Moodle 2.3 Slowness / freezing when editing a course

Visvanath Ratnaweera發表於
Particularly helpful Moodlers的相片 Translators的相片
Hi

No, please don't repost: http://docs.moodle.org/23/en/Moodle.org_forums_Code_of_Conduct#Post_your_question_in_one_forum_only.

The suggestion was to move the whole thread to "Hardware and performance" forum. Only the moderator of this forum (General problems) can do it. But since the discussion is going on here and your issue looks like a bug in Moodle, I would wait till the cause of the problem is found.
In reply to Visvanath Ratnaweera

Re: Moodle 2.3 Slowness / freezing when editing a course

mr 626發表於

Umm...I didn't say I was going to repost?

I think the thread is okay here anyway- yes, it is performance related but the evidence is pointing towards it being due to a problem (or bug, if you will) with moodle. Hence it isn't out of place in the general problems forum 微笑

Anyhow, thanks for the replies everyone. From the activity on the Moodle Tracker it sounds like its only a matter of time before this is resolved.

In reply to mr 626

Re: Moodle 2.3 Slowness / freezing when editing a course

Howard Miller發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片
What's your network connection like?

I've noticed that 2.3 (editing) pages take a loooong time to load. I presume they have more javascript libraries for the drag-and-drop and suchlike. I have been meaning to make a comparison with a tool like YSlow.
In reply to Howard Miller

Re: Moodle 2.3 Slowness / freezing when editing a course

mr 626發表於

Gigabit everywhere- I think I can rule that out as the issue 微笑

In reply to mr 626

Re: Moodle 2.3 Slowness / freezing when editing a course

Justin Gomes發表於

We are experiencing this issue also.

It happens on the same network as the moodle server and when testing on the webserver itself. So it doesn't appear to be network/bandwidth related.

In reply to mr 626

Re: Moodle 2.3 Slowness / freezing when editing a course

Garret Gengler發表於

This is going to seem out of left field.  Bear with me though... this might be the solution.

Assuming you are running Apache, take a look at the Keep-Alive timeout setting in /etc/apache2/apache2.conf

We haven't thought about this problem in several years, because the defaults changed in Debian.  But back in the Moodle 1.5 days, I spent about several weeks troubleshooting a problem exactly like you are describing.     The problem only affected Internet Explorer... pages would time out inexplicably.   There was nothing in the log files, the server load was manageable, every other browser performed fine.

The problem turned out to be the Apache setting KeepAliveTimeout.  

I found what I added to the Moodle 1.9 docs about this... 

Microsoft Internet Explorer has a (little) known bug that causes seriously problems with SSL-enabled Apache websites. The issue is that if a web server's KeepAlive timeout is set to less than 60 seconds (say to the default of 15 seconds), MSIE can get confused about whether a keep-alive connection is available or not. As a result, any browser POST requests (which always use a keep-alive if available) will fail to reach the server. This is easily reproduced with postings to the Moodle forums. Using MSIE, connect to an ssl-enabled Moodle site. Write a quick forum post, and submit it when the form has been displayed for between 15 seconds and 60 seconds. You will see a browser error message, and your post content will be lost. In some cases, doing this will even crash the Windows TCP stack on the client machine. So, if your site is SSL-enabled, and you use Apache, you should set the KeepAliveTimeout to at least 60 seconds.

Good luck!
-Garret

評比平均分數:Useful (1)
In reply to Garret Gengler

Re: Moodle 2.3 Slowness / freezing when editing a course

Garret Gengler發表於

I did a little more digging around.

MSIE 8 and 9 apparently still has a minimum keep-alive timeout of 60 seconds.    The only way to change that is a registry setting (on the client machine)... so it's impractical to fix for every user interacting with your site.

So.. fixing it on the Apache side is the only solution.    I believe Debian has changed the default.. it's set to 90 seconds on my servers now (which are debian squeeze), and I don't remember changing it.   But it may have been set by our lead sysadmin, who did the install.

In any event, 90 seconds works great for our install.  Anything greater than 60 should be safe.

-Garret

 

In reply to Garret Gengler

Re: Moodle 2.3 Slowness / freezing when editing a course

mr 626發表於

Garret,

I'd forgotten all about that setting! As you say, not something that we've had to think about for a while.

Apache on my opensuse box has the setting (in /etc/apache2/server-tuning.conf) set at a default value of 15. I will try 90 and see if that helps

Thanks for your investigating

EDIT: unfortunately this doesn't seem to help- still experience the same issue. Thanks for the suggestion though

In reply to mr 626

Re: Moodle 2.3 Slowness / freezing when editing a course

mr 626發表於

Hi all,

I realised that I hadn't tried everything mentioned on the bug tracker for this issue ( http://tracker.moodle.org/browse/MDL-34328 ).

Today, I followed the suggestion of turning off opening of moodle docs in a new window. Doesn't seem like something that would make much difference, but it does appear to have helped things.

With the moodle docs setting changed, Firefox works quite well- typically around a 5 second delay before the page is loaded after hitting the 'turn editing on' button in the course. Internet Explorer still has issues but it does load eventually which is better than it was before.

I've noticed that the last element of the page that loads is always the 'move topic' icon that is displayed on the left of the topic box. I appreciate that just because it is visually the last element to load doesn't mean that it actually is, but I thought I'd mention it anyway to see if that is consistent with other people's experiences.

In reply to mr 626

Re: Moodle 2.3 Slowness / freezing when editing a course

Donna Hrynkiw發表於

I've got an issue similar to MDL-34328 but while the symptoms are much the same, the activity that generates the error is entirely different. Does anyone know of any similar issues/bug reports?

Joe Faculty gets the error "A script on this page is causing Internet Explorer to run slowly" when he goes to post a forum reply in IE 8. The screen pauses while loading the blue Attachment box, the twirly stops and IE complains about a script. Interestingly enough, the error only shows on a forum REPLY, not a new discussion topic.

He is the only person reporting this issue, but most of our faculty use Firefox, and I AM (alas) able to reproduce the problem. I don't get the error in any other file-attaching/uploading activity in Moodle I've tried.

We're running M2.2.6.

Hrynkiw

Kwantlen Polytechnic University

 

 

 

 

In reply to Donna Hrynkiw

Re: Moodle 2.3 Slowness / freezing when editing a course

Oksana Delgado發表於

We have received exactly the same reports from many of our users:

When they try reply to forum posts they receive slow scrip error. This had been reported with FF 18, IE 8 and 9. Safari works fine. No problems have been noticed when loading other pages or creating a new discussion. We are using Moodle 2.2.1 (Build: 20120109)

Unfortunately I was not able to reproduce the issue.

I have tried all options mentioned here or in MDL-34328 , but users continue reporting teh same problem.

Does anyone has any more suggestions or run into the same problem?

Oksana

Athabasca University

 

In reply to Oksana Delgado

Re: Moodle 2.3 Slowness / freezing when editing a course

Celine Armenta發表於

Hi everyone!

In my case, slowness and freezing  are happening enery time we try an editing task (in either  IE, Chrome, FF). We are using Moodle 2.3; we already tried the options mentioned in MDL-34328; it seemed to work for a while; not any more.

It´s good to know we are not alone!

Celine

Universidad Iberoamericana Puebla, MX