Pictures not loading

Pictures not loading

by Russell Thomson -
Number of replies: 12

Hi,

Moodle 2.6.7

For no apparent reason pictures on Moodle pages with more than one image could not load all of them.  I did not upgrade; I tried it on different ISPs and computers and still had the problem.  I got in touch with my webhosting service and this was their reply

'It seems to be an issue with the Moodle software that seem to be consuming high memory usage or it requires some tweaks in its php settings. This is not an issue on the server end.  Please consult with the Moodle Support and ask if any changes or modifications are expected on the server to have this test run. So, that we can help you accordingly.'


Can anybody help, thanks


Average of ratings: -
In reply to Russell Thomson

Re: Pictures not loading

by Przemek Kaszubski -
Picture of Particularly helpful Moodlers Picture of Testers

How big (file size) are the pictures? 

How many are you trying to load at once?

Moodle pages do not behave like facebook walls etc. - there is no gradual ajax-based load as you scroll down. Caching, too, does not apply there as far as I know.

In reply to Przemek Kaszubski

Re: Pictures not loading

by Russell Thomson -

This is something that just started to happen; the pages loaded without any  problem for months. Typical pages are 5 x 22KB and 12 X 15KB. 

In reply to Russell Thomson

Re: Pictures not loading

by Przemek Kaszubski -
Picture of Particularly helpful Moodlers Picture of Testers

Are these images embedded within the page's editor or loaded from external URL's?

In reply to Przemek Kaszubski

Re: Pictures not loading

by Russell Thomson -

Uploaded through text editor

In reply to Russell Thomson

Re: Pictures not loading

by Przemek Kaszubski -
Picture of Particularly helpful Moodlers Picture of Testers

  1. I once - in a different context - had a problem with .jpeg files failing to load. I changed their extensions to .jpg and all was fine.
  2. Have you tried turning on the debugging to see if Moodle throws some errors?
  3. Have you tried duplicating the resource to see if the pics would load, or else rebuilding the page totally, adding the pictures one by one, saving and testing?


In reply to Przemek Kaszubski

Re: Pictures not loading

by Russell Thomson -

Debugging did not throw up any errors.

I did as you suggested and built the page one picture at a time. Here are the results.

Build 1 - Picture 1 - No problem

Build 2 - Picture 1 - No problem / Picture 2 - No problem

Build 3 - Picture 1 - No problem / Picture 2 - No problem / Picture 3 - Did not load

Build 4 - Picture 1 - No problem / Picture 2 - Did not load / Picture 3 - Did not load / Picture 4 - No problem

Build 5 - Picture 1 - No problem / Picture 2 - Did not load / Picture 3 - No problem / Picture 4 - No problem / Picture 5 - Did not load

Came out and re-entered the quiz: Pictures 2 and 4 did not load 

Did quiz and corrected it. Corrected quiz Pictures 3 and 5 did not load.

There does not seem to be any logic to it and I want to stress that I didn't change Moodle in any way (mainly because I don't have the expertise). I did not update to a different version. It just started to happen. What could cause this kind of problem; I'm not sure I believe the webhoster when he says - 'It seems to be an issue with the Moodle software that seem to be consuming high memory usage or it requires some tweaks in its php settings. This is not an issue on the server end.' Since Moodle has remained the same and some of these pages have worked without a problem for over a year and all the others have loaded without a problem, it's the only other constant that could have changed but I have no idea what they could have done.

Thanks for your help



In reply to Russell Thomson

Re: Pictures not loading

by Przemek Kaszubski -
Picture of Particularly helpful Moodlers Picture of Testers

Weird.. I can't see any pattern there either.. This does look like a server issue. They may have updated something, changed a setting, or added a service etc. I think you'd need to ask them to copy and paste the precise alerts from the server logs; otherwise, it's too much hit-or-miss on this end..

A couple of additional comments / questions:

  1. What happens when a picture does not load? Does the alternative text kick in then?
  2. I just wonder what would happen if you put these pictures somewhere else and embedded them this ways, via external URL's. Do they load then?
  3. Do you ever tinker with the HTML code at all after adding the pic's from the editor, or not?
  4. BTW when you say "quiz", do you mean the main quiz edit settings page with the description or a question? I'm not sure this matters, but would just like to know.

Maybe one other thing you can try is to test how your quiz works on the http://school.demo.moodle.net/ . You'll have max 1 hour for the edits, because the site resets each hour on the hour.

If I or whoever else were to help you further, I think we'd either need teacher-level access to your course, or at least a copy of the quiz (question) with the pictures. I could use a local install of 2.6.7, which I have handy, for some testing, but I think the best bet is really for someone to see your work in the original, i.e. in your course and on your website. I'm not a Moodle.org employee or dev, just a community member, so if you cannot trust me enough, you might want to wait for someone from moodle.org's support team.

Regards,

Przemek

In reply to Przemek Kaszubski

Re: Pictures not loading

by Russell Thomson -

Hi Przemek,

I received the following email from the webhosting service.

There are no issues with the server.  I was looking into the error_log file in your Moodle directory and it says that your Moodle page is making too many connections to the database.  This could be causing the pages to load slowly and some images to not load.  You will need to look into having Moodle limit the number of connections to the database.

How do I do this?

Regards

Russell




In reply to Russell Thomson

Re: Pictures not loading

by Przemek Kaszubski -
Picture of Particularly helpful Moodlers Picture of Testers

Assuming it's all Linux, I think you need to ask them to change the setting in the appropriate my.cnf file. Which one is the correct one for you and your account with them is something they need to know. Mostl likely each server user has their own my.cnf file, but they also can have higher level instances of that file that carry the defaults.

Anyways, the setting in question is 

max_connections = ...

Make sure it does not say = 100, but something bigger. We have 300 (for Moodle 2.6.8), but I've seen settings with 500 connections as well, so you might try to haggle for that.

Has you site gone busier lately? Added many new users and / or activities? This could explain why previously stable resources now behave erratically.

HTH.

Przemek

Average of ratings: Useful (1)
In reply to Przemek Kaszubski

Re: Pictures not loading

by Russell Thomson -

Thanks again Przemek,

I'm a self-employed English teacher with about 50 students so 'busier' is always a relative term; regarding activities, I am constatntly adding new activities but not a large amout all at once, unless there is a tipping point effect. I've probably overused Embedded answers (Cloze) and made them quite complex. During the summer I will have to go through the quizzes and simplify them.

Thanks for your help,


Russell

In reply to Russell Thomson

Re: Pictures not loading

by Przemek Kaszubski -
Picture of Particularly helpful Moodlers Picture of Testers

OK, Russell. I hope the problem will be resolved with the new setting etc. If any of the suggestions really helped, please rate it "Useful". Thanks.

In reply to Russell Thomson

Re: Pictures not loading

by Andy Chaplin -

Hi Russell

I have a s site with a similar load to yours had the same problem a few months ago, and was actually blocked by my ISP for a short while.

In my case it was because debugging was turned on and that was causing all the extra calls to the server.  I turned it off and everything was fine.

Your case may be different, but the symptoms are the same.

Hope all goes well!


Andy


Average of ratings: Useful (1)