Best practice forum (Archived)

Backup and restore timeouts

 
Sarah Cao
Backup and restore timeouts
by Sarah Cao - Thursday, 22 August 2013, 1:04 PM
 

I have an instance that is severely affected by long times and timeouts while backing up and restoring courses.

The backup file itself is only 2 MB, but it does have a large number of quizzes and question banks (around 120; with 15 Qs per quiz and ~30 Qs per question bank), and there are many courses with this format or half the number of quizzes. It can end up trying to restore for an hour before it times out. Sometimes the restore occurs in the background even prior to a timeout, if I open another browser and log in to check (without the browser or incognito window, the user is stuck waiting and cannot navigate around the LMS while restoring). However, it also occurs with brand new courses with one quiz in it. 

Some solutions that have been attempted include increasing timeout limits, upgrading from 2.2 to 2.4 for improved caching, deleting quizzes and question banks, and various troubleshooting and config changes. 

Here is a Moodle bug that looks related https://tracker.moodle.org/browse/MDL-29439.  

If there is any advice or fixes, suggestions are welcome as this issue has been getting progressively worse. 

me
Re: Backup and restore timeouts
by George Angus - Sunday, 25 August 2013, 7:45 PM
Group Totara

Hi Sarah,

I had set about recreating what you have when it occurred to me it would be faster if you sent me the back-up of the course! Is this possible?

regards,

George.

me
Re: Backup and restore timeouts
by George Angus - Monday, 26 August 2013, 7:34 PM
Group Totara

Hi Sarah,

We encountered similar problems here - its definitely a performance issue and we will look into it.

regards,

George.

David Curry (Core Developer)
Re: Backup and restore timeouts
by David Curry (Core Developer) - Tuesday, 10 September 2013, 10:02 PM
Group Totara

Hey Sarah,

I replicated this issue today by trying to restore the file you sent to George, timed out in under a minute. So I added "
"@set_time_limit(0);" (setting the timeout to infinite) near the top of /backup/restore.php and ran it again to see if it would ever complete. And it did, after a good 15-20 minutes anyway. This might do as a temporary fix, I'll upload a patchset file of the change (it really is just a one liner). This was tested on Totara 2.4, and it looks like some Moodle performance upgrades were included in Moodle 2.3 for backup/restore, so if you are on 2.2 and this doesn't work you might want to consider upgrading to 2.4.

I read through that moodle bug you mentioned and it splits off into 2-3 other ones near the end, this one looks like the real culprit here https://tracker.moodle.org/browse/MDL-39726 . Which is still in progress, I have voted for it (you might want to do the same?) and will look into backporting it into an earlier version of Totara as soon as it is completed.

Hope that helps.

Cheers
David

Sarah Cao
Re: Backup and restore timeouts
by Sarah Cao - Monday, 16 September 2013, 1:20 PM
 

Hi David, 

Thank you for the patch; I still ended up timing out after an hour unfortunately, but the course did restore in the end. We upgraded from 2.2 to 2.4 for the performance upgrades and improved caching, but still experience this issue.

Thanks for the link to the bug as well, I'll follow the progress on that. A related question: the bug says it's due to "large question bank restoration", but our client said they also tested restoring a new course with short quizzes and it still takes a while, although it was less severe. Do you think it's related or a separate issue?