Hardware and performance

Moodle 2.4.1 performance running slow

 
 
This is me.  Deal with it!
Moodle 2.4.1 performance running slow
Group Testers

Hi, 

We are running moodle and mySQL on a single linux VMWare virtual server with 4gb of Ram.

We upgraded from 2.3 to 2.4.1 over the weekend and then yesterday noticed that page load times are 3 times slower after the upgrade.  The Performance stats are as below:

2.3

Load Time: 0.6 Seconds

Memory Used: 32.1MB

DB Read/Writes 101/27

Server Load: 0.95

Session Size: 21.6kb

2.4.1 ( the same course)

Load Time: 1.9 Seconds

Memory Used: 43.4MB

DB Read/Writes 107/26

Server Load: 0.01

Session Size: 26.3kb

I don't understand why this is hapening and how to rectify it.  Can anyone help me understand what might be happening?

Thanks

Kieran

 
Average of ratings: -
Picture of Visvanath Ratnaweera
Re: Moodle 2.4.1 performance running slow
Group Particularly helpful Moodlers
Hi

The usual cause is the slow database performance of (desktop) virtualization. Since you are comparing the same Moodle course on the same virtual machine on same system software (LAMP) something else is wrong.

1. Moodle 2.4.1 needs 43.4 MB whereas 2.3 needed 32.1 MB.
Contradicts this oberservation: http://www.iteachwithmoodle.com/2012/11/17/moodle-2-4-beta-performance-test-comparison-with-moodle-2-3/.

2. Server Load: 0.95 in 2.3 against 0.01 (!) in 2.4.1
Do you have an explanation? Was the virtual machine busy with something else during the 2.3 measurement? What else the (virtualazation) host does? Is it possible that in 2.4.1 the CPU was just waiting for I/O?

What you need is careful monitoring of key parameters in your server. See performance documentation for details.
 
Average of ratings: -
This is me.  Deal with it!
Re: Moodle 2.4.1 performance running slow
Group Testers

No, the virtual Server just has Moodle and the mail server on it.  If I move the mySQL to a different server am I likely to notice a speed improvment?

 
Average of ratings: -
Picture of Visvanath Ratnaweera
Re: Moodle 2.4.1 performance running slow
Group Particularly helpful Moodlers
Hi Kieren

You wrote:
> No, the virtual Server just has Moodle and the mail server on it.

You mean, in
>> 2. Server Load: 0.95 in 2.3 against 0.01 (!) in 2.4.1
>> Do you have an explanation? Was the virtual machine busy with something else during the 2.3 measurement? What else the (virtualazation) host does?

neither the VM nor the host were doing any work other than serving the "same" course page to a single user in both cases, version 2.3 and version 2.4.1?

> If I move the MySQL to a different server am I likely to notice a speed improvement?

No, unless the database was the bottleneck and the new database server is faster.

What about:
>> Is it possible that in 2.4.1 the CPU was just waiting for I/O?
>>
>> What you need is careful monitoring of key parameters in your server. See performance documentation for details.
???

May be you can follow the other sub-thread. Since you have this measurement ready, you can vary different parameters in the server and look at the result. I would undo each change before trying the next, and document the changes which had an impact.
 
Average of ratings: -
Picture of Simon Story
Re: Moodle 2.4.1 performance running slow
 

Hi Kieren,

If you look in <your site>/admin/phpinfo.php what is 'apc.shm_size' equal to? Is it even present?

32mb is the default for Ubuntu and probably other installations of APC, really it should be >128M. If it's too small it does basically nothing.

 
Average of ratings: -
I Teach With Moodle
Re: Moodle 2.4.1 performance running slow
Group Particularly helpful MoodlersGroup Testers

I wouldn't be at all surprised if your system went into swap at some point and never fully recovered from it.  Could you please post the output of the 'top' command?

If you have any swap used, a reboot will solve the issue temporarily, and then you'll need to prevent your system from going into swap again

Cheers, 
Fred

 
Average of ratings: -
This is me.  Deal with it!
Re: Moodle 2.4.1 performance running slow
Group Testers

Just checked the apc.shm_size and you're right it is 32mb.  So I'll change that.  But what is the 'top' command?  I'm pretty new to the server side of Moodle.

 
Average of ratings: -
I Teach With Moodle
Re: Moodle 2.4.1 performance running slow
Group Particularly helpful MoodlersGroup Testers

if you're running Moodle on a Linux server, it is possible to use the 'top' command line. Basically, you need to get into the server using command line (or SSH) so that you can type commands (a simple guide here). It will show you some basic information about how your system is running e.g. how much RAM is being used, etc.

You can see an example of what it looks like here.

I am not sure what type of server you are using.

Cheers, 
Fred

 
Average of ratings: -
Picture of Simon Story
Re: Moodle 2.4.1 performance running slow
 

What linux are you using?

If it were Ubuntu, add the lines:

apc.shm_size=128m
apc.num_files_hint=15000

To /etc/php5/conf.d/apc.ini

And restart apache / php-fpm

I have no idea where it could be if you are running another linux distribution.

This is not the magic bullet, there is much more you can do than this. But having a php cache (Like apc) setup somewhat correctly is a very good start to making Moodle run well.

'top' is a program you can use to see what is going on on your machine. Just run 'top' from the command line and follow your nose.

But, I don't think a linux machine having had a swap-thrash in the past is overly detrimental to performance.

 
Average of ratings: -
This is me.  Deal with it!
Re: Moodle 2.4.1 performance running slow
Group Testers

Thanks for the help everyone.  I'll try those settings now..

 
Average of ratings: -
This is me.  Deal with it!
Re: Moodle 2.4.1 performance running slow
Group Testers

Just to finish this thread off, I changed the settings in php.ini for APC and the results for the same course are now:

Load Time: 0.4 Seconds

Server Load: 0.25

This has sped up our Moodle noticably.  Thanks for all the help.

 
Average of ratings:Useful (1)
Picture of Stephen Overall
Re: Moodle 2.4.1 performance running slow
 

There's also lots of very helpful information on this Moodle Docs page...

http://docs.moodle.org/23/en/Installing_APC_in_Windows

Even though the first portion of the page focuses on Windows servers, the later portions are applicable to Linux environments or any Moodle installation.

In particular, the sections on "Monitoring and tuning the [APC] cache" and "APC.php security" cover how to securely install and access from within Moodle the APC Opcode Cache's own cache administration scripts which let the Moodle admin monitor and even clear the APC cache in real time. Very useful in tuning the APC cache settings for your own server's needs.

 http://docs.moodle.org/23/en/Installing_APC_in_Windows#Monitoring_and_tuning_the_cache 

 
Average of ratings:Useful (3)