Moodle causing memory problems and crashing server

Moodle causing memory problems and crashing server

by Leon Philpot -
Number of replies: 6

I am brand new to all of this, so excuse my ignorance.  I have the following set up running currently.

AT&T Linux Virtual Dedicated Server with 512Mb memory.  Running Moodle 2.0.4 Build 20118017,  Apache/2.0.64 (Red Hat) unsure of Linux version.  PHP version 5.2.17.

MySQL db info is MySQL client version 5.1.45 server version 5.5.9 and protocol version 10.

Not sure what all of that means but under the phpMyAdmin control panel I get two error messages.  Thought I would include them in case these point to the problem: 1) The additional features for working with linked tables has been deactivated.  20 Your PHP MySQL library version 5.1.45 differs from your MySQL server version 5.5.9.  This may cause unpredictable behavior.

My problem is my server runs out of memory and locks up.  Many times it also locks up my shell program and the control panel causing me to have AT&T restart the server.  This temporarily fixes the problem as it resets everything freeing up the memory.  I have noticed when I am running the top command in the shell that the httpd processes seem to increase in size until they use all the memory.  AT&T technicians have told me they believe this to be a coding problem in Moodle's interaction with MySQL db.  The server will remain running for several days if no one is using Moodle.  However, most of the time I am the only user logged in and I am setting up additional users on Moodle and a few courses.  I have found that if I go slow and take my time between users the problem is not as bad,  but if I go quickly then the server will run out of memory in as little at 5-10 minutes.

I have tried to include as much information as possible, but if you need anything else please let me know.  I don't know anything about Linux except what little I've learned dealing with this.  Any help you can give me would be greatly appreciated as I have about 450 deputies to get going with this on-line training.  Thanks.

Average of ratings: -
In reply to Leon Philpot

Re: Moodle causing memory problems and crashing server

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

> AT&T Linux Virtual Dedicated Server with 512Mb memory.

Must be one of these http://webhosting.att.com/server-solutions/virtual-for-linux-os.aspx. Which plan is it? Interestingly the amount of RAM doesn't appear under resources.

> Running Moodle 2.0.4 Build 20118017,

AT&T doesn't seem to provide their Moodle installation. How exactly did you install AMP (Apache/MySQL/PHP) and Moodle?


> Apache/2.0.64 (Red Hat) unsure of Linux version. PHP version 5.2.17.

Full 64 bit system? What is the purpose for 512 MB RAM?

They say "Red Hat Enterprise Linux 4 ES" in the above page. Looks rather ancient to me, since RHEL 6.2 is the current, 5.6/7 would be OK. Moodle 2.0 needs PHP v 5.2.8 http://docs.moodle.org/20/en/Installing_Moodle#Software, 5.2.17 is OK.

> MySQL db info is MySQL client version 5.1.45 server version 5.5.9 and protocol version 10.

The server version, 5.5.9, should be OK.

> but under the phpMyAdmin control panel I get two error messages. Thought I would include them in case these point to the problem: 1) The additional features for working with linked tables has been deactivated.

Never encountered that. A quick web search brought up collisions with the engine types MyISAM vs. InnoDB vs in MySQL.

> 2) Your PHP MySQL library version 5.1.45 differs from your MySQL server version 5.5.9. This may cause unpredictable behavior.

Did your hoster install MySQL for you?

> My problem is my server runs out of memory and locks up. Many times it also locks up my shell program and the control panel causing me to have AT&T restart the server.

The two errors above may or may not be related to this lock up, but should be cleared before going further.
In reply to Visvanath Ratnaweera

Re: Moodle causing memory problems and crashing server

by Leon Philpot -

Hello,

We are on the Basic plan with an upgrade to the Enhanced plan.  This will doble the amount of memory available. 

AT&T set up the Apache and PHP, they also started the MySQL and I had to configure it.  I downloaded Moodle and followed the install instructions to get everything up and running. 

The Red Hat Enterpise Linux 4 ES has the Linux 2.6.18 and Red Hat 3.4.6N running on a 32 bit system.  As far as the 512 Mb of memory, that is what they offered on their plan.  I guess they pretty much sold me a bill of goods, as they also told me they hosted multiple Moodle sites and would be able to give me some help getting problems ironed out, but now they're not as helpfull.

When I asked them about my MySQL errors, they basically said the it was on me to figure it out and get them resolved.  They said I have access under the shell program to install what I want, but this is all way to new to me to start just trying to install/upgrade stuff.  Here is a list of the modules available for me to install:

ant             mailman         mysql5.5        procmail-lda    swish-e
clamav          majorcool       mysqlcheck      procmail        tcl
cpx             majordomo       openvpn         pukiwiki        timezone
dada            miva-empresa    openwebmail     python-2.5      tomcat
dovecot         mod_perl        php4            python          trendmicro
eruby           mod_python      php5.2          quotachecker    urchin5
fml             mod_ruby        php5.3          rails           webalizer
formmail        mtop            php5            samba3          webmin
gpgformmail     mysql           phpmyadmin      sendmail-rbls   wordpress
innotop         mysql4.1        phppgadmin      sendmailcert    zendoptimizer
java_jdk        mysql5.0        postgresql      spamassassin    zope
java_jre        mysql5.1        postgresql7     squirrelmail

Don't know if this helps answer all the questions.  Thanks for your help.

In reply to Leon Philpot

Re: Moodle causing memory problems and crashing server

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

> We are on the Basic plan with an upgrade to the Enhanced plan. This will doble the amount of memory available.

$ 80.-/month for 512 MB RAM, $ 110.-/month for 1 GB, both only 10 GB disk space? Whereas the CPU is not even specified? I'm skeptical.

> AT&T set up the Apache and PHP, they also started the MySQL and I had to configure it. I downloaded Moodle and followed the install instructions to get everything up and running.

OK. Must be these instructions http://docs.moodle.org/20/en/Installing_Moodle.

> The Red Hat Enterpise Linux 4 ES has the Linux 2.6.18 and Red Hat 3.4.6N running on a 32 bit system.

Yes, for low memory 32 bit is more suitable.

> As far as the 512 Mb of memory, that is what they offered on their plan. I guess they pretty much sold me a bill of goods, as they also told me they hosted multiple Moodle sites and would be able to give me some help getting problems ironed out, but now they're not as helpfull.

See above.

> When I asked them about my MySQL errors, they basically said the it was on me to figure it out and get them resolved.

I hope a MySQL person from the community would help you there.
In reply to Leon Philpot

Re: Moodle causing memory problems and crashing server

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

What is a "virtual dedicated" server, BTW?

I found these combinations in Wikipedia:
- http://en.wikipedia.org/wiki/Hardware_virtualization
- http://en.wikipedia.org/wiki/Virtual_machine
- http://en.wikipedia.org/wiki/Virtual_private_server
but didn't find the combination "virtual dedicated".

May be your hoster mean it metaphorically, as in:

If it's there and you can see it          it's REAL
If it's there and you can't see it        it's TRANSPARENT
If it's not there and you can see it      it's VIRTUAL
If it's not there and you can't see it    it's GONE!

                                                  Roy Wikles, 1983

In reply to Visvanath Ratnaweera

Re: Moodle causing memory problems and crashing server

by sam marshall -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

From the last Wikipedia article you linked: 'The term virtual dedicated server or VDS is used less often for the same concept, however it may indicate that the server does not use burst/shared ram through multiple machines, as well as individual CPU cores'.

In this case probably the RAM is reserved just for that VM, which is probably why it has such a small amount (it has to be a small proportion of the real machine's RAM as they will host lots of servers on one machine).

--sam