Performance issues when updating a record in Moodle 3.0.3

Performance issues when updating a record in Moodle 3.0.3

by SECOMV EMARF -
Number of replies: 7

Hi, Folks,

Today I was trying to update a record and it lasted more than a minute to save it. I contacted the support and they found out that the standard log table had around 19 million records, what sounded strange to me because our instance was installed 6 months ago and we are not heavy users (not many courses and a small number of students per course). The Logging plugin is set up to never delete log records.

Is this performance issue related to this huge number of records in the standard log table? 

I've read the documentation and I can't see what's wrong, so I really appreciate your help.

Regards.

Luiz




Average of ratings: -
In reply to SECOMV EMARF

Re: Performance issues when updating a record in Moodle 3.0.3

by SECOMV EMARF -

Hi, Folks,

Just adding info to the question above, when I search the log I see exactly the same record repeated several times. Below, we can see the same record (Course view by system, August, 1st, 23:59) repeated - It's just an extract of at least a hundred equal records!

Hora
Nome completo
Usuário afetado
Contexto do Evento
Componente
Nome do evento
Descrição
Origem
endereço IP
1 Ago, 23:59--Página principalSistemaCurso vistoThe user with id '0' viewed the course with id '1'.web172.16.1.106
1 Ago, 23:59--Página principalSistemaCurso vistoThe user with id '0' viewed the course with id '1'.web172.16.1.106
1 Ago, 23:59--Página principalSistemaCurso vistoThe user with id '0' viewed the course with id '1'.web172.16.1.106
1 Ago, 23:59--Página principalSistemaCurso vistoThe user with id '0' viewed the course with id '1'.web172.16.1.106
1 Ago, 23:59--Página principalSistemaCurso vistoThe user with id '0' viewed the course with id '1'.web172.16.1.106
1 Ago, 23:59--Página principalSistemaCurso vistoThe user with id '0' viewed the course with id '1'.web172.16.1.106
1 Ago, 23:59--Página principalSistemaCurso vistoThe user with id '0' viewed the course with id '1'.web172.16.1.106

Any idea of what's going on?

Thank you.

Luiz

In reply to SECOMV EMARF

Re: Performance issues when updating a record in Moodle 3.0.3

by John Provasnik -
Picture of Particularly helpful Moodlers Picture of Testers

Not related to what you initially posted, but your screen shot reminds me of something I experienced last year -- we had a student who (claim's her 'cat') held down the refresh key on her keyboard, for approx 17 minutes - this caused 350 identical log entries of this user viewing the course which looked similar to your screenshot above -- just the time changed.

In reply to John Provasnik

Re: Performance issues when updating a record in Moodle 3.0.3

by SECOMV EMARF -

Hi, John,

Thanks, but it seems that, in my case, the system is inserting the same record multiple times. I see no reason for that since I haven't changed the code and the cron.php is run each 15 minutes.

Regards,

Luiz


In reply to SECOMV EMARF

Re: Performance issues when updating a record in Moodle 3.0.3

by Ken Task -
Picture of Particularly helpful Moodlers

User ID 0 is the guest user. The course viewed is ID 1 which is the front page.

Now why the repeats so frequently, could be related to the IP address seen in each line.  The ip address is a private IP and identifiyable only in the private network where your moodle server resides.   The IP could be a computer or a device (smartphone or tablet).   So you've have to search other logs/tables for that IP address being used.

A little db sluething might reveal:

select * from `mdl_user` where `lastip` like "IPADDRESS"

If you had command line access to the Moodle server and it was linux, I'd suggest watching realtime access logs specifically for that IP.

Something like:

tail -f ssl_access_log |grep IPADDRESS

'spirit of sharing', Ken



In reply to Ken Task

Re: Performance issues when updating a record in Moodle 3.0.3

by SECOMV EMARF -

Hi, Ken,

When you said it was the guest user accessing the front page, it came to my mind that a robot could be hiting the site. I asked the support and they said that IP number was from a Google Search Appliance server that we have installed in our institution.

Then I remembered a couple of months ago I had changed the front page from the login only view to a list of the courses, so the GSA was indexing and Moodle was recording in the log table those "guest" user accesses.

I turned back to login page and asked the support to add an exception so GSA would not index from Moodle's URL anymore. No more strange records added to the log table since this configuration was done. Problem solved!!!

What I think it's strange is that I haven't changed Moodle's setup option to be indexed by Google, but the front page was indexed anyway. I don't know if it should work like this.

Thank you very much for your help. I really appreciate.

Luiz


In reply to SECOMV EMARF

Re: Performance issues when updating a record in Moodle 3.0.3

by Ken Task -
Picture of Particularly helpful Moodlers

Glad that's solved.   I doubt that Alphabets Search Applicance folks really talk to Google Search folks even though one born from the other.   Do remember reading that many who purchased Google Search Appliance discovered it 'discovered too much' - always yin/yang.

One doesn't have to turn on access to Google for the search engine to search your site.   While many engines claim to honor robots.txt I've seen some that want their own engines definitions in robots.txt.   Plus, anyone knowing of robots.txt (and all of internet does) could, as individuals, see what it is you're trying to hide from search engines.

As an example ... any Moodle site that displays the calendar on the front page that requires no login to view might see search engines recognize a calendar and even though Moodle now shows only today's date as linkable, the search engine will seek every day in the current month and year ... even try years back ... oh say to 1900 and then gradually work it's way to present day.

The ONLY way to keep search engines away from Moodle ... force logins - to see anything.

Just the nature of the internet today. ;)

'spirit of sharing', Ken



In reply to Ken Task

Re: Performance issues when updating a record in Moodle 3.0.3

by SECOMV EMARF -

Hi, Ken,

I see. 

Yes, that's what I thought. That's why I changed the configuration in order to force login, so I could solve the problem.

Thank you very much once again.

Regards,

Luiz