Moodle 2.2 on apache working with MS SQL db - problem with restoring the course

Moodle 2.2 on apache working with MS SQL db - problem with restoring the course

by Jaroslaw Jozwik -
Number of replies: 4

Hello

My name is Jarek Jozwik and I am new to moodle but have already installed a few instances for testing.

Our university decided to move to moodle, so we need to build a proper infrastructure.

After some testing and considerations we decided to go with moodle on redhat with apache, php, apc or xcache accelerator, unixodbc and freetds - all connected to MS SQL database on (obviously) windows server, cluster actually. I have managed to install and configure all and it is working quite nice but I hit a wall, one problem at the moment actually. Restoring the course from 1.9 version takes ages. All other things are okay - just this one.

From the trace I have performed on the database it is not a bottleneck. Problem is probably with apache, php or database driver - after course restoration starts one apache process show 99% of CPU. What is interesting it has no impact on whole server - everything else works fine.

We have also another server, with very similar configuration, except moodle works with mysql instead of ms sql. And there - the same course was restored in under 2 minutes.

The course contains pages, quizes, images, documents etc. Zip is around 8.5MB so it is not very large.

Has anyone encountered such problem? Any advice would be appreciated.

Thanks

More info on request.

Average of ratings: -
In reply to Jaroslaw Jozwik

Re: Moodle 2.2 on apache working with MS SQL db - problem with restoring the course

by Alan Kmiecik -

I am trying to run Moodle 2.2 on a account hosted at Hostgator and am running into performance issues too.

Nothing as specific as Jarek, the system just seems to hang at times and, at other times, runs like a champ.

I've done about a dozen Moodle instances, have been in IT for 25+ years so, have experience with Moodle and problem determination and, at this point, am stuck. 

Not sure if it is the hosting company, Moodle 2.2 or what.  Also, nothing to narrow down to "it happesn while I am doing this"

In reply to Alan Kmiecik

Re: Moodle 2.2 on apache working with MS SQL db - problem with restoring the course

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
> Not sure if it is the hosting company, Moodle 2.2 or what. Also, nothing to narrow down to "it happesn while I am doing this"

Monitor and debug!

I don't know how far the hoster reveal the total load of a machine to shared users. May be you are stuck there. You can try simple methods like in this post: http://moodle.org/mod/forum/discuss.php?d=196122.
In reply to Jaroslaw Jozwik

Re: Moodle 2.2 on apache working with MS SQL db - problem with restoring the course

by Gregor McNish -
Picture of Particularly helpful Moodlers

This may be a bit late to help. There's also a good deal of conjecture here.

We've had erratic issues with MS-SQL and backup/restore, particularly with big (many resources) courses. After much testing I find that the database just doesn't respond to a request after a while== you can watch the progress of the build of the backup and see where it stops. Introducing a time out at a particular point in the code will throw an error (there isn't one set by default) -- so what appears to be a performance issue is actually the process just waiting....

My suspicion is that moodle's backup doesn't play nicely with mssql temp tables; because temp tables are tied to the db session, if the db needs to reconnect during the backup process, it no longer has access to the temp tables.

I rewrote the bits of backup/restore dealing with temp tables to use a real table rather than a temp table, and backup/restore works fine (though only for one course at a time, which is a problem).

I'm not sure if I posted this to the tracker for real experts to look at. I certainly meant to...