My Moodle site runs really slow in the computer lab; home users are okay

My Moodle site runs really slow in the computer lab; home users are okay

by Frankie Kam -
Number of replies: 15
Picture of Plugin developers

HELP!!! My website http://scm.moodleace.com runs (loads) really slow in my college computer lab. Runs is the wrong word. Crawl. That's better. I am using Moodle 1.9.7.

My Moodle site runs on a Virtual Private Server on Linux Centos 5.3 with 512 Mb RAM, CPU 250 Mhz. Paying the equivalent of USD25@ month (in Malaysia). Total capacity of VPS Hard Disk size is 20 Gig, I have 10 Gig Hard disk space available. Maximum number of users in the computer lab is 30 users. Usually < 15 users concurrently online. Even with a 2.0Mbps ADSL line pumped into the lab, access is painfully slow.

My webhost page is http://www.internet-webhosting.com/vps.php

Am desperate enough to let one of the supergeeks on this forum check out my Moodle admin settings with admin password or by granting him or her admin rights. Yeah, that's how desparate I am. What's under the hood of my Moodle site? I've read the http://docs.moodle.org/en/Performance_FAQ and am still seeing stars.

Funny thing is, most of my students who access my site from their homes report that the site loads up okay - from home.

Anyone out there who can advice me on some benchmarking code to test how fast or slow my site is? I've  read about the Performance Perspective Script
http://moodle.org/mod/forum/discuss.php?d=57028
but I am unwilling to take risks with running it on my production site.

Sorry for so many questions in one post. Your advice please.

Desparately seeking solace
Frankie Kam
Malaysia

BTW, I've attached the list of activities (mods), blocks and filters that i have installed on my Moodle 1.9.7 site. It's not a very long list. mixed But you might want to take a look at it anyway.

Average of ratings: -
In reply to Frankie Kam

Re: My Moodle site runs really slow in the computer lab; home users are okay

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

Since there are no benchmarks or any system usage measurements I can only give some general recommendations.

> I am using Moodle 1.9.7.

People have reported some performance issues with this version. In any case update to the latest 1.9. Don't neglect the usual precausions, if something goes wrong you must be able to come back to exactly the same setup you had before starting the update.

> My Moodle site runs on a Virtual Private Server on Linux Centos 5.3 with 512 Mb RAM, CPU 250 Mhz.

CentOS is a good choice. Still a VPS with 512 MB RAM is weak for a busy Moodle site. How does the 250 MHz compare to a physical processor, can you give a comparable Intel or AMD model?

> Maximum number of users in the computer lab is 30 users. Usually < 15 users concurrently online.

As often repeated here, what those users are doing is very important. If they just scan pages or write forums postings or working on local programms they consume much less power compared to taking online tests.

> Even with a 2.0Mbps ADSL line pumped into the lab, access is painfully slow.

You say the downlink to the lab is 2 Mbit/s? That is not high for an ADSL? You can measure the throughput of the network connection by downloading a big file from the server.

In any case, could there be a problem with the school network? Firewalls, proxyservers, DNS, ...?

What is the uplink speed of your server?

> My webhost page is http://www.internet-webhosting.com/vps.php

BTW, the USD 25 Linux solution, 'Basic Container', says 256 MB. ??

> Funny thing is, most of my students who access my site from their homes report that the site loads up okay - from home.

May be at those times there are fewer users. That's why you need usage measurements correlated to times of poor performance.

> Anyone out there who can advice me on some benchmarking code to test how fast or slow my site is? I've read about the Performance Perspective Script
http://moodle.org/mod/forum/discuss.php?d=57028
but I am unwilling to take risks with running it on my production site.

The Moodle-specific alternative is the new e-peen script http://moodle.org/mod/forum/discuss.php?d=162251 Otherwise you have to go for general system performance monitors like http://munin-monitoring.org/ , http://www.cacti.net/ , http://sysusage.darold.net/ , etc

> I've attached the list of activities (mods), blocks and filters that i have installed on my Moodle 1.9.7 site. It's not a very long list.

The filters consume power. You can deactivate them and compare.

BTW. your attachment has two problems. Just for three lists of names, you don't need a spread sheet. The posting itself can handle that. In case you need one, try to use an open format, like those from OpenOffice.org, if you must take the 'old' office format DOC, XLS extra, for God's sake not their OOXML blemish DOCX, XLSX of the MS Office 2010!
In reply to Visvanath Ratnaweera

Re: My Moodle site runs really slow in the computer lab; home users are okay

by Frankie Kam -
Picture of Plugin developers

Visvanath

Many thanks for the quick reply, great advice given and insights into my slow connections. BTW, my web host company informed me that my "VPS will have 512Kbps internet connection speed". If I upgrade to a dedicated server (at 3x the cost!), then they will give me 1Mbps connection from the server.

The 256Mb they advertise is correct. but did you see the "Extra 256Mb RAM added" for all packages text at the top of the Web Host webpage? That's why I have 512Mb.....I'm planning to add to an extra 512Mb and test the system to see if that makes a diffence.

Frankie Kam, Malaysia

In reply to Visvanath Ratnaweera

Re: My Moodle site runs really slow in the computer lab; home users are okay

by Frankie Kam -
Picture of Plugin developers

I have a choice between

A: Increasing the VPS' RAM from 512Mb to 1Gigb

or

B: Increasing the VPS Server line from 512kbs to 1Mbps

But NOT both.

Which do you suggest I go for?

In reply to Frankie Kam

Re: My Moodle site runs really slow in the computer lab; home users are okay

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

> A: Increasing the VPS' RAM from 512Mb to 1Gigb
>
> or
>
> B: Increasing the VPS Server line from 512kbs to 1Mbps

None is free I guess. You might want to see a direct return from your investment. That will happen only if you replace the weakest link of the chain, which is still unclear.

You have to load the server, artificially or real use, at the same time monitoring the critical points as mentioned in the earlier post. Find out where it gets saturated!

In reply to Visvanath Ratnaweera

Re: My Moodle site runs really slow in the computer lab; home users are okay

by Frankie Kam -
Picture of Plugin developers

Visvanath

A NEW DEVELOPMENT! I INSTALLED eAccelerator on my Moodle Site!
Woohoo!

I used these websites:
http://aldenzi.blogspot.com/2008/07/install-eaccelerator-on-centos-52.html
and
http://www.techiecorner.com/111/install-eaccelerator-optimize-php-performance-reduce-server-load
to add the PHP Accelerator, eaccelerator to scm.moodleace.com!!!

I also modified /etc/php.ini with these settings:
memory_limit = 256M
realpath_cache_size = 128K  (original was 16K)
realpath_cache_ttl = 150  (original was 120)

I then restart MySQL server:-
$ /etc/init.d/mysqld start

and also restart Apace:-
$ httpd -k restart

...and the RESULT IS...I still don't know as the acid test is with 10 or more students logging into the Computer Lab.

Frankie Kam

In reply to Frankie Kam

Re: My Moodle site runs really slow in the computer lab; home users are okay

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Frankie

You wrote 8. Januar 2011, 19:01
> ...and the RESULT IS...I still don't know

Any updates on this matter?
In reply to Visvanath Ratnaweera

Re: My Moodle site runs really slow in the computer lab; home users are okay

by Frankie Kam -
Picture of Plugin developers

Well Visvanath. Since 8/1/2011, I've done 2 tests of logging on to my Moodle site with 22 PCs "simultaneously".  Well actually each PC logged on to http://scm.moodleace.com one after another - I enlisted help from 5 other individuals to type the URL at the address bar of the Web Browser of each PC and then we serially hit the Enter Key one after the other.

The results were VERY encouraging with 18 to 20 PCs logging in and even managing to enter the various Courses. 2 to 3 PCs hung with a white screen.

Given that weeks ago, the same attempt would result in almost ALL PCs hanging with a white screen, both the tests were a great success.

My conclusion: A PHP Accelerator is a definite MUST. I've also beefed up the site with mod_deflate to zip (compress) outbound data so that my Web Browser (Firefox) can decompress the data on the fly.

I've also incorporated the recommendations of YSlow (Yahoo) which are:
1. Minify Javascript code to reduce the size of js script files,
2. Combine Javascript files into one file where possible
3. Run my site through http://gtmetrix.com with results ranging from
Page Speed Grades of 79% to 82%
and YSlow Grades of 75% to 83%
depending on how many and the types of blocks I display on my homePage.
4. Installed Munin graphs to visually assess the load on my server
5. Optimised MySQL and Apache (googled stuff)
6. Tried my hand at browser caching of static (gif, jpg) files

So far, it's working SO MUCH BETTER now. You can see some screen shots below. And I save my boss RM ($$$) from having to upgrade to more RAM/broadband upload/download pipeline or having to rent a Dedicated Server.

Thanks for asking
Frankie Kam

In reply to Frankie Kam

Re: My Moodle site runs really slow in the computer lab; home users are okay

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Frankie

> My conclusion: A PHP Accelerator is a definite MUST.

So you stayed with the same VPS and manged to boost the performance by installing a PHP-accelerator. Can we safely assume then that your bottleneck was the CPU?

> I've also beefed up the site with mod_deflate to zip (compress) outbound data so that my Web Browser (Firefox) can decompress the data on the fly.
>
> I've also incorporated the recommendations of YSlow (Yahoo) which are:
> 1. Minify Javascript code to reduce the size of js script files,
> 2. Combine Javascript files into one file where possible

Are the improvements equally dramatic like with the PHP-accelerator?

Could you tell how exactly you optimized Javascript?

> 3. Run my site through http://gtmetrix.com with results ranging from
> Page Speed Grades of 79% to 82%
> and YSlow Grades of 75% to 83%
> depending on how many and the types of blocks I display on my homePage.
> 4. Installed Munin graphs to visually assess the load on my server

Did Munin confirm the theory that CPU was the bottleneck?

> And I save my boss RM ($$) from having to upgrade to more RAM/broadband upload/download pipeline or having to rent a Dedicated Server.

In the western world at least, the personell costs much more than equipment. So one gets great improvements of the QoS by investing a small amount on equipment. (How inhumane it may sound.)
In reply to Visvanath Ratnaweera

Re: My Moodle site runs really slow in the computer lab; home users are okay

by Frankie Kam -
Picture of Plugin developers

>> Could you tell how exactly you optimized Javascript?
>>
Well I just appended the contents of one javascript file into another, and then
edited the PHP file that included the original javascript files, so that that PHP file now just included the one-code-combined javascript file.

>>Did Munin confirm the theory that CPU was the bottleneck?
>>
To tell you the truth, this is Greek to me.
Here you can take a look at Moodle site's Mnin data:
Just log in as Guest.
http://scm.moodleace.com/mod/lightboxgallery/view.php?id=2017

Tell me what you see, because like I said, it's all Greek to me.

Frankie Kam

In reply to Visvanath Ratnaweera

Re: My Moodle site runs really slow in the computer lab; home users are okay

by Roman Boom -

Don't pay attention to all those A,B,C

just optimize your site to the maximum, that's all

I think you actually need this test

In reply to Roman Boom

Re: My Moodle site runs really slow in the computer lab; home users are okay

by Frankie Kam -
Picture of Plugin developers

Thanks Roman and thanks for the good advice!

That site you've given to me is GREAT!

In reply to Frankie Kam

Re: My Moodle site runs really slow in the computer lab; home users are okay

by HJWUCGA INC. -

I was also going to suggest eAccelerator...

Also, change the db engine type to InnoDB.

In reply to HJWUCGA INC.

Re: My Moodle site runs really slow in the computer lab; home users are okay

by Frankie Kam -
Picture of Plugin developers

Hj

You mean in my /etc/my.cnf file I should make the default storage engine as INNODB? Are you sure I won't lose my current data since most of my tables are of the ISAM type.

[mysqld]
#default_storage_engine=INNODB

Please let me know.

Frankie