Too slow course backup

Too slow course backup

by moodle learner -
Number of replies: 1

i am using moodle 2.7+

ubuntu system

Ram : 4 GB..HDD:500GB

i have one course backup file .mbz of 25 mb.I take almost 1 hour to take the course backup.I take 1.5 hours for restore.Do you anyone knows how to increase speed or is this the real time to take for restore of 25 mb. Please help me.

Average of ratings: -
In reply to moodle learner

Re: Too slow course backup

by Ken Task -
Picture of Particularly helpful Moodlers

Much depends upon what's in the course.  25 MB .mbz is really a zip so it's actually/probably a little larger than that depending upon the resources/files contained in the course.   Then there are modules which do require more processing by the shear nature of the mod ... like quiz.   How many quizzes does the course contain?

Are there any external resources ... items that are being pulled into the course from another server?

Suggest experimenting with the backup of the course ... when you get to a the form to select/elect what resources in the course to backup, exclude all quizzes.    Name the backup with some indication in the file name.   Example: a no user backup tacks onto the end of the file name (before the .mbz extension) a '-nu' - meaning 'no users'.   So if you have excluded all quizzes, at the end of the backup file name add '-nq' so when you inspect them locally you'll know what the backup is supposed to exclude.

A .mbz backup is a zip.   Suggest downloading the .mbz backup, changing the extension to a .zip and unzip it in a local test folder.   Un-zip it there and inspect contents ... check out the files.xml file to see the humanly recognizable file names and the file sizes ... found in the files_dir of the extracted backup.

Also suggest doing this ... since you have Ubuntu you have command line - ssh access.  As root user:

cd moodledata/temp/backup/

Then issue a 'watch' command: watch "ls -lR" [ENTER]   That will refresh every 2 seconds.

Then, using a browser, access a course and run a backup.

Look back at the terminal window to see what the backup is doing.

You'll be able to tell in both windows what part of the backup is taking so long.

BTW, int e terminal screen, Moodle must create a moodle_backup.xml file as that serves as a map of the contents of the backup.  The larger that file is/becomes, the larger the course.

On the other side of the coin, at least your backups are completing (ie, no failing).   Yes, we all have 'instant gratification syndrome' today.   Between slow and completing (even though it takes time) I'd prefer the latter.

Also, zipping/unzipping could be heavy process on your server.   What else is the server doing at the times you are creating these backups?    Are the courses being accessed still?   Any other server services kicking in that use resources?    Part of your backup routine is getting an sql dump from the DB.   The bottle neck might also be the speed at which the data is extracted from the DB server.   Is MySQL server on local host?  or is DB server remote?   Have you run anything to check the performance of your DB?   mysqltuner for example?  Could be you are in need of some MySQL tweaks.

'spirit of sharing', Ken

Average of ratings: Useful (3)