Forums | Mahara Community

Support /
Mahara is generating weird URLs - very slow page load times when editing pages


anonymous profile picture
Account deleted
Posts: 25

24 August 2011, 11:41

We are experiencing very long load times on our Mahara site when users edit any of their pages.We are running Mahara 1.4.1 on 3 load balanced CentOS webservers and 1 MySQL database server.

When trying to edit any "page" (or view, as they used to be called), the ajax-y stuff will hang. In fact, once you experience this when editing a page, your whole session becomes really really slow-even when trying to navigate to other mahara html pages- until it resolves whatever it was doing. If you open a different browser while the other one is having these issues and log in (starting a new session), pages load fine.

Does anyone have any idea what might be causing this?

We were getting a ton of errors in the apache error_log about some php timezone settings, but I changed that and they seem to have disappeared. Now there are no other errors in the log.

One thing strange we have noticed is that on each page, Mahara seems to be generating a weird URL in the header for theme files:

var config = {
     'theme': {"images\/icon_close.gif":"http:\/\/our.site.edu\/mahara\/theme\/raw\/static\/images\/icon_close.gif",

Would this have anything to do with the slowness? What might be causing the /\/\ to appear in just this section of the header? Is there a way to refresh the theme's cache like in Moodle?

Thanks in advance!

-Tony

anonymous profile picture
Account deleted
Posts: 808

24 August 2011, 17:55

Hi Tony,

I doubt the weird-looking urls have anything to do with it, I think that escaping of / is just due to json-encoding.

You can clear the theme template cache on the server by removing the dwoo/cache & dwoo/compile directories under dataroot.

But I'm not sure that's your problem.  Is it hanging when you click the block configuration button/drag & drop a block around on the page, or is it when you save the block?

One thing I'd try in your situation is putting some logging near the top of view/blocks.json.php - say something like

log_debug($_POST);

somewhere after init.php is included, and then look at the log when you click the configure button.  That will at least tell you whether the ajax request is reaching the server.

anonymous profile picture
Account deleted
Posts: 25

26 August 2011, 14:45

Hi Richard,

Thanks for the suggestion. The issue seems to be happening when the blocks.json.php tries to load, not the blocks.php.

Here's another piece of info: We iterated through our 3 servers, turning them on and off and then testing to eliminate the possibility of one of the nodes being bad. We test by going to portfolio, click on one of my views, then click "Edit this page". Everything up until this point is very snappy - no hanging at all. Even navigating to any other page on the site is really quick. As soon as I click "Edit this page" probably 10% of the time it hangs after the page loads, when it's trying to load the images for the drag-and-drop json stuff. If it doesn't hang, I can click around to other tabs of this edit screen and eventually, the Icons won't load and it will hang with the "Loading" text in the top left of the page. It might hang for a minute or two before it relinquishes its hold on my session, allowing me to navigate to other pages again. Just to reiterate, once it hangs, my entire session becomes unsuable until it finishes processing whatever it began to process. If I open a different browser and log in, the new session works fine.

So, the problem seems to be sporadic. Sometimes it works amazing, then randomly it will freeze up while trying to add content to one of your pages. I did add the debugging info to the blocks.json.php and here's what it reports every time I click a new "tab" within the ajax-y part of the edit screen:

[Fri Aug 26 10:03:38 2011] [error] [client 10.10.1.66] [DBG] a4 (view/blocks.json.php:32) Array, referer: http://learning.up.edu/mahara/view/blocks.php?id=193&new=1
[Fri Aug 26 10:03:38 2011] [error] [client 10.10.1.66] [DBG] a4 (view/blocks.json.php:32) (, referer: http://learning.up.edu/mahara/view/blocks.php?id=193&new=1
[Fri Aug 26 10:03:38 2011] [error] [client 10.10.1.66] [DBG] a4 (view/blocks.json.php:32)     [id] => 193, referer: http://learning.up.edu/mahara/view/blocks.php?id=193&new=1
[Fri Aug 26 10:03:38 2011] [error] [client 10.10.1.66] [DBG] a4 (view/blocks.json.php:32)     [change] => 1, referer: http://learning.up.edu/mahara/view/blocks.php?id=193&new=1
[Fri Aug 26 10:03:38 2011] [error] [client 10.10.1.66] [DBG] a4 (view/blocks.json.php:32)     [blocktype] => filedownload, referer: http://learning.up.edu/mahara/view/blocks.php?id=193&new=1
[Fri Aug 26 10:03:38 2011] [error] [client 10.10.1.66] [DBG] a4 (view/blocks.json.php:32)     [action_addblocktype_column_1_order_1] => true, referer: http://learning.up.edu/mahara/view/blocks.php?id=193&new=1
[Fri Aug 26 10:03:38 2011] [error] [client 10.10.1.66] [DBG] a4 (view/blocks.json.php:32)     [sesskey] => STD4ZzgpKweRa5I2, referer: http://learning.up.edu/mahara/view/blocks.php?id=193&new=1
[Fri Aug 26 10:03:38 2011] [error] [client 10.10.1.66] [DBG] a4 (view/blocks.json.php:32) ), referer: http://learning.up.edu/mahara/view/blocks.php?id=193&new=1
[Fri Aug 26 10:03:38 2011] [error] [client 10.10.1.66] [DBG] a4 (view/blocks.json.php:32) , referer: http://learning.up.edu/mahara/view/blocks.php?id=193&new=1

I'm not sure if that means anything...

Also, one more thing on the sessions - it seems like once you have a session going which doesn't ever freeze, everything works fine. If you open a new browser/new session and it happens to be a bad one, things will freeze. Weird, no?

-Tony

anonymous profile picture
Account deleted
Posts: 808

28 August 2011, 17:42

Right, so you can sometimes see the problem with images failing to load as soon as you click "Edit this page"?  Before you actually try to make any changes to the view?

If so, that makes me think it's nothing to do with the ajax requests at all.

Does it happen purely randomly no matter which view you're editing, or which browser you're using, or can you see some pattern?

anonymous profile picture
Account deleted
Posts: 25

29 August 2011, 19:25

Richard -

That's correct. If all the images load fine, adding a "widget" to a view will also work fine. It only presents itself as a problem when the blocks.json.php fails to fully load. We've been able to make this occur on multiple browsers and yeah, it is seemly random :(

I think it may have to do with our load balancing... we are going to try and switch the webserver to one that's not behind the load balancer and see if that makes a difference. We are also hosting the SSL certificate off of the load balancer, which Mahara gets really confused about (I've already reported this as a bug in hopes that Mahara will gain a feature similar to moodle's ssl_proxy setting). Do you think that could cause a problem in any way?

Thanks again for the continued assistance.

-Tony

5 results